So, I think it is better to make the relevant directories into ZFS subvolumes and snapshotting before & after the installation of a port, and if something goes wrong or you don't need it anymore, restore it from the snapshot.
This is how OpenSolaris (and I guess also Solaris) works for a full update. What is done is a kind of full snapshot of the system, the creation of a new boot environment so that you can even change those part of the system that you don't want to remember of, and you can get back in time. So not only you can restore your previous configuration, but you can even boot it and see how it worked without having to touch the final configuration.
By the way, snapshotting [file]/var[/file] and [file]/usr/local[/file] should suffice. I would add [file]/etc[/file] if you don't already backup diligently configuration files, since usually adding a new program via ports mean you are going to enable some services and/or adjust some firewall rules.