Maybe use is_action_just_pressed instead of is_action_pressed?
is_action_pressed returns true every frame when the action is held down, whereas is_action_just_pressed returns true only the first frame when the action is held down.
If you use Input.is_action_just_pressed(), that’ll only trigger in the single frame where the input is triggered. That’s different than Input.is_action_pressed(), which fires in EVERY frame where the input is triggered.
You could only play an animation when no other animation is playing (where appropriate). To do that, you can use the is_playing() method of the player. So, something like:
.
if !_animation_player.is_playing():
_animation_player.play("your_animation")