This comes up a lot. Thank you for at least considering that there is SOME sort of pattern and not just stupid randoms.
Personally, I would like to see someone do some testing on it. I find that the mages have a preference for self buffing but I wonder if they dont have a valid union complaint. Can it be RPG'd as "he didnt give me anything buffy to wear so Im going to buff myself"?
For your project you might want to do some solo games with debug (-dd) turned on. Or ask for the games logs from one of the servers. Especially if its a finished game. Have the server run one more turning with logging on then zip up and send you the logs. (I highly advise asking for only ONE turns logging because they are really REALLY big)
Here is one small bit of one debug log for one round of combat of one battle for one commander named Zrakhnadar.
http://www.dom3minions.com/files/spell_ai.txt
A few of these should at least give you a list of what spells are considered and possibly what kind of weighting is given. If you come up with any specific suggestions to that then please let me know.