Is there an XML way to stop AI building something whilst leaving it ok for human players.
Not in MegaGlest. I do believe GAE's wall attribute will currently have the AI ignore the building (for now, until the AI can handle walls), though I could be wrong, and nothing uses walls yet, so pretty untested.
also, is there a way of making a unit die after it's attacked once, like a suicide unit?
Well, you could give it one health (or low health), and have a splash attack with short enough range to ensure it will always be killed by the splash of its own attack. If you don't want others killing it so easily, make a custom armour type and give it extreme weakness to a custom attack type which you'll use for the splash attack.