I don't think there is any native way to get the action queue items - is there?
So what you initially asked for -
When you use an item, can you cancel using the item when hit.
Once the item animation has played, that's when the script plays - so its too late at this point.
The only chance to stop the item being used before that, is when it is in the action queue, and all you can do is
ClearAllIActions(); or whatever it is called - which will empty the action queue.
You could put that in a creatures Claw / Sword etc impact script - so it clears the actions of the player it strikes - but then that could disrupt normal combat actions too.
You can make a pseudo onHit event via using the default.nss script.
By monitoring your current hp each hb, you can determine if you have suffered any damage.
You can then modify your idea so the onActivate item plays a casting animation for 2 seconds.
During those two seconds - if your health changes - then you know you suffered a hit.
Then you set a local variable 'OnHit' to 1
In your onActivate script - you wait for those 2 seconds, then check the value of the variable.
If it is equal to 1 = play spell fizzle animation.
If it is equal to 0 = complete the casting, and do the desired effect
Without nwnx - there is no nice clean way to do it.