Could be done with events, but it would be hard as forget to apply every event to every brick. Unless you just package onPlant and make it apply some relay events. Could do onLoadPlant, as well.
onRelay > Self > fireRelayUp
onRelay > Self > fakeKillBrick [#]
That would be the events. To collapse it, just put something that fires relays. This is the really simple version, but like zmaster said, you'd need to apply a variable to every single brick. You'd also have to raise the schedule quota to at LEAST the amount of bricks you're planning on building, or just make it 128,000. I may try to make a collapse script later, but it would be very basic and probably inefficient due to the sheer amount of bricks.