How to break a looping?

you just need to create a condition where the loop fails, for instance on end overlap begin a a different animation. in your case though it should actually be a loop it should just be stuck in the shooting animation until there is another overlap.

if you were using ai perception then it would be on see enemy begin shooting loop, then on lose sight of enemy go back to patrolling.