Alternatively, you can also use the "Anti Magic Shield" of the banshee. There is an option to either absorb all damage for X seconds or a specific amount of physical/magical damage for X seconds. You can find it in the object editor.
Btw: Your spell doesn't work. If you make a unit invulerable, it cannot be targetted/attacked by units unless they are allowed to target invulerable units.
If you want to make a spell, that casts the spell on the unit, make a dummy unit, remove all shadows and attacks and things like that and then make it cast the spell on the triggering unit you desired it on. You can also change animations and stuff, so no problem in that case.
Hope, that helped.
If not, you can PM me or wait for another person's answer in here.
Gaegamel