Well, I had a test project that basically inserted a special AIProc into the game using a custom loader. The AIProc was in an external DLL, and would link in to the game in such a way that it would be called no matter what level was being played, and without interfering with the usual AIProc for that level.
In theory, it could be used to control an AI on an arbitrary map. But then, it was mostly just the hooking that I did, and a simple test to see that it really could order units around. The project kinda stopped there. So yeah, you could build in some sort of AI by just issuing orders to player[1] in single player (which is generally always going to be the AI), or some other player number in multiplayer. I'm sure it could determine the number of players (/human players) and or just figure out which ones to place under AI control.
Oh, and how the loader works is really cool. I basically downloaded a really nice project I found on the internet. It starts a process but in suspended mode, allocates memory in the remote process, writes data to the memory about which DLL to load, creates a new thread in that process which then calls LoadLibrary on the DLL of your choosing (the name of the DLL needs to be in the address space of the calling process, hence the mem alloc and write), and then it cleans up and unpauses the program. You get the process started with your nice custom DLL loaded into it. (thumbsup) I thought it was just amazingly kick ass. The person who wrote it needs a pat on the back.