Another problem: http://www.creationkit.com/Dispel says I should be able to do "NPCRef.Dispel Flames", but my code:
ActorCaster.Dispel spellToCast
Edit: Ah, I see. I was confusing the Effect Archetype Dispel with the ActiveMagicEffects Function Dispel. Man there's a lot of confusing cross-referencing going on here!
HasMagicEffectWithKeyword <- Look this up in the Wiki. It's the closest to what you're looking for. Still would need to run a loop over all possible Magic Effect Keywords to check if ANY Magic affact is active on that actor.