You could use an integer too to keep track of which animation is playing.
On key pressed
Set animation to instanceInt
Set instanceInt to (instanceInt + 1) % 2
A bit tidier and permits you to add a third or even more animations to your attack sequence !