What I really don't like about your system, Anitarf, is that it tend to do to much in the majority of cases. Add some optimization possibilities, and I shall bow before you.
Some suggestions (which would be compatible with your current syntax):
First suggestion is to make a struct-like function from two arrays. Storing boolean wantStruct and function pointer Response. Then we link table to the "struct" instead of the response ability (enabling us to bypass the struct population if it isn't needed).
private integer array $name$N
private wantStruct array $name$wantStruct
private Response array $name$Response
function RegisterSpell$name$Response takes integer spellId, Response r returns nothing
if spellId==0 then
Second suggestion is to be able to turn off the global events. All maps don't have use for them ( <=> there is at least one map which doesn't :)
private constant boolean USE_ALL_SPELL_EVENTS
function $NAME$WhateverSpellEffectIsTriggering takes nothing returns nothing
local integer N = $NAME$table[GetSpellAbilityId()]
if $NAME$wantStruct[N] then
if USE_ALL_SPELL_EVENTS then