There is a way to do this all (and much more) without needing to 'automate' stuff. I doubt blizzard intended this, but basically you (ab)use the world map. You check against a stack of lightning shield orbs, if it's more than 7 all good, if not the world map is triggered which prevents the spell from going through. It takes a bit of creativity to set it all up with isboxer and the flow on your actionbar, but it works 100% fine.
In pvp you could use windshear spam, and let your addon check if a spell is interrupted or not, if one of your guys interrupted it, the other ones won't blow their as it gets blocked by the world map. If you find it annoying, you can also change the opacity/transparency of it.