This is a complex topic.
I highly recommend
working through all of the World Editor and Scripting documents : http://www.roostertailgames.com/TorqueRef/index.html
(this is my personal copy - there are others available that may be more up-to-date).
Much of the documentation is outdated but if you're willing to work through the initial learning curve it shouldn't be too hard to adapt the older examples to the newer engine.
AI isn't built in, you have to script it yourself. AIPlayer objects exist, but without some scripting they will just stand there.