I fixed so it uses local trigger t for you Hanky, to save you the trouble (yeah I was bored). The updated map is attached to this post.
Also, for your init function, couldn't you do the following instead of using a loop?
JASS:
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function SpellIdCondition))
And the condition would look a little something like this:
JASS:
function SpellIdCondition takes nothing returns boolean
return GetSpellAbilityId() == yourspellidhere
endfunction
(The attached map does not contain an edited init function apart from it using local trigger t)