I have encountered this a number of times, it seems to be the main thing that will cause EQ2Bot scripts to get stuck in loops. A bot will be casting a spell, something will happen to interrupt (knockback aoe, whatever) and then Me.CastingSpell stays on afterwards.
I've looked into making some changes to avoid using Me.CastingSpell, but I'm having some troubles with the Ability.CastingTime value.
It seems Ability.CastingTime is zero sometimes for abilities that aren't instant cast, is this related to the abilities book not being read fully at times perhaps?