And if you mean to add a spell with a scripted outcome, that is possible too. You just need to crate a new spell that affects self (anything will do, like a 1 second Feather, etc.) and write something like this, then make it a start script (Tribunal required):
Begin myscriptshort doonceif ( "player"->GetSpellEffects, "myspell" == 1 ) if ( doonce == 0 ) set doonce to 1 ;Scripted effects go here endifelse set doonce to 0endifEnd
Now of course, the drawback of this is if you make it a start script, it will run indefinitely and drain system resources even if the player doesn't know or use the spell, as long as the mod is loaded. For that reason I generally prefer to make it somehow tied to an inventory item, activator, or actor and attach the script to that object instead. However that way the script will only run if that object is in one of the loaded cells.