You could just use fxDTSBrick's 'getUpBrick(<index>)' method to detect if there is a brick above that brick, and if there isn't, then add a physical zone to the brick. However, if there is a brick above it, it would just keep going up the chain until it finds an end point.
And use fxDTSBrick's 'onPlant()' and 'onRemove()' methods to recalculate physical zones near the planted brick (so you don't have to re-calculate every brick on the server; only the ones near the affected brick).
The method above does cause several problems to arise, including breaking a brick chain by putting a hole in a wall of 1x1s (consequently making the chain stop at the hole and allowing rain to go through the top of the original chain), and the amount of calculation if you have a bunch of bricks in the server.
Sorry if I'm not making a whole lot of sense; I came up with this method on the spot, and I haven't had enough time to think it out entirely. Just wanted to put it out there to let someone build off of it. Hope it still somewhat helps you with optimizing this add-on, though.