make sure you test it on warp outs, zone changes and on character deaths, since EVENT_END will trigger with those actions too.
Right, it could possibly litter the world with spell scrolls. I think there are a few other things that will cause an EVENT_END, such as leveling up.
A possible workaround for applying this to active skills as well is the 'Skill Required' property in the skill editor. You can input the NAME string of one skill into another to require the caster to know that spell before the skill can be cast. Since you're removing the scroll skill, then wanting the item-creation skill to fire only if you no longer have access to the scroll skill, you'll need to finagle it to get a negative requirement. BUT, this means you can refund scrolls even for active skills...
It's complex, but I might suggest this:
Hidden Passive ControllerThis uses a passive skill to simulate a negative requirement. The negative requirement skill will be a
hidden passive skill which means you'll have to attach this to every possible class you want to be compatible with the mod. This drastically decreases your mod's compatibility with custom classes unless you find some sort of UI or level layout workaround. You'll also have to create one of these for each and every spell scroll, but cloning them should be fairly easy once you have a working template.
In any case, the negative requirement skill will hold the Skill Required property. It will also be a 'always on' passive skill. So, if the spell scroll skill is learned, the skill is ON. If the scroll is unlearned, or hasn't yet been learned, the negative requirement skill will be turned OFF (EVENT_END). So, you would just need to follow the EVENT_END -> EXECUTE_SKILL setup described above, but place it on this passive instead of the original spell scroll skill. And yes, you'll need an 'item-refund skill' that actually fires on this passive's EVENT_END.
I don't think this will fix the possibility of littering the world with spell scrolls, though.