Well you see that part where I put
if (akTarget != Game.GetPlayer()) Returnendif
?
That means that it'll stop running if the target of the spell wasn't the player. And in the rest of the script I just used "akTarget" because that's shorter than typing out "Game.GetPlayer()".
The akTarget is set by the event. If you don't know how an event works, I'm not sure I can explain it well.
Basically, almost anything that happens in the game sets off an event, and every event has parameters that come with it. In this case, the script is listening for an "OnEffectStart" event. So when the effect that this script is attached to receives this event, it also receives the parameters for who was the target, and who was the caster.
In the beginning line of the event, I had
Event OnEffectStart(Actor akTarget, Actor akCaster)
which tells the game that the script is listening for this event, and that we are assigning the name akTarget to the first parameter, and akCaster to the second parameter. (The first parameter is always the target, and the second parameter is always the caster). I could have used
Event OnEffectStart(Actor IGotHit, Actor IHitYou)
just as well. Do note, however, that "akTarget" is only a valid variable inside this event. So if we were planning to use the information elsewhere in the script, we should have declared a variable at the beginning of the script and then assigned it the value of akTarget.
And OnActivate is also an event. It comes with a parameter pointing to the activating reference. Check the http://www.creationkit.com/OnActivate_-_ObjectReference on it.