
JASS:
IsUnitAlly(GetFilterUnit(), GetOwningPlayer(caster))
will get the unit as an ally

JASS:
IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(caster))
since both statements refer to the same unit, that would mean it will only return true if the unit is both an ally and enemy, which is quite impossible.
Just remove the IsUnitEnemy() statement.