M_s4, I think EzDay2 means that he wants a templar to cast psi storm, or a defiler to cast plague, etc, not for the computer to play a melee game (which is what most of the AI scripts are for)
A very similar thread is
here.
Not much testing has been done on this, but the basic suggestion is to provoke the unit by attacking it, or letting it see an enemy unit.
There are AI scripts available in Starforge or SCXE for:
- building and launching nukes
- casting disruption web
- casting recall