I believe you could also work directly with the tgd xml file. I've written a small program to parse this file to remove/replace camera data, tgo's, etc. and it seems to work.
It isn't interactive (for example, I can't change an objects position in my utility and see it change in TG2; TG2 has to reload the tgd file.) But I could see a 1) create scene, 2) run random script on it, 3) reload scene and render.
Actually, that might be a pretty interesting project as I think about it.