I think anything *could* work. The issue is we've not been told an exhaustive list of disallowed actions, only a single one, casting spells directly on people. The reality is dwarven law probably has a bunch of other provisions as well. Well, given the pedantry of dwarves in this setting thus far, I'd expect dwarven law has many many many more actions that aren't allowed, likely including everything except the single rules lawyery out that the main characters are going to use, if indeed this situation is resolved in such a fashion. Which makes it hard to guess what the loop hole will be.
But destroying and deforming property with magical abilities wouldn't be my guess for an action that isn't against the law. Although it's totally possible that that turns out to be the exception.
The fact that dwarven undead are an exception to the only dwarf rule already seems like a somewhat glaring flaw in the design of this system, unless it was specifically put in to allow good undead to continue to govern. I mean, presumably Duergar aren't allowed, and in D&D terms I'd call them closer to a dwarf then a vampire dwarf. So maybe the designers of this whole thing were a lot less pedantic then I would expect from dwarves making secure their highest functions of government. Maybe the same dwarves who built Dorukan dungeon built this place.