The misalignment occurs when bricks are rotated at 90 or -90 degrees. Or should I say AREN'T rotated at 90 or -90 degrees. They are actually rotated (-)90.0002 degrees, and (most likely not coincidentally) this is the same as the error produced when torque converts between radians and degrees.
Place 4 bricks each rotated 90 degrees more than the other, and look at <thebrick>.rotation for each
Then look at what is returned by mradtodeg(mdegtorad(90))
WOAH! IT'S THE SAME!
Floating bricks, buried bricks, overlapping bricks, etc. can be checked via containers and raycasts.
Now I'm not saying that you should reinvent the wheel, I'm just saying that it's possible (as far as I can tell atleast. That said, ::plant() may be in the engine and not written in torquescript, in which case the reason it's there is because it does things which are not exposed to us via torquescript, so we should call it regardless).