Solved. This will automatically unregister on the death of the actor when the Magic Effect dispels.
It is amazing what you forget after 6 months.
Scriptname CInvisibility extends ActiveMagicEffect
SPELL Property Invisibility Auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
RegisterForAnimationEvent(GetTargetActor(), "weaponSwing")
RegisterForAnimationEvent(GetTargetActor(), "arrowRelease")
RegisterForAnimationEvent(GetTargetActor(), "weaponDraw")
RegisterForAnimationEvent(GetTargetActor(), "MRh_SpellFire_Event")
RegisterForAnimationEvent(GetTargetActor(), "MLh_SpellFire_Event")
endEvent
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
if (akSource == GetTargetActor())
If (asEventName == "weaponSwing") || (asEventName == "arrowRelease") || (asEventName == "weaponDraw") || (asEventName == "MLh_SpellFire_Event") || (asEventName == "MRh_SpellFire_Event")
Utility.Wait(0.3)
Invisibility.Cast(GetTargetActor(),GetTargetActor())
EndIf
EndIf
endEvent