Please save the abilities into a hashtable to reduce lookup time. If you have hundreds of spells registered to the system, it will really bog it down.
Also why aren't you using effects, they are a lot less overhead performance wise and installing the script. Effects are now capable of doing anything a unit can, animation wise (and more).