I'm not sure if this will work, but here's something to try.
How about instead of putting the code in the input event, you make the input event change a variable, and then put an elif in the if on floor to check if the variable is true.
In the animation player, you can make isEating = false once the animation stops playing, by using an animation_finsihed() function (you need to add it in the animation player at the end of the animation to emit the signal.
var isEating = false
func _input(event):
if event is InputEventKey
if event.pressed and event.scancode == KEY_1:
isEating = true
#function below should automatically appear when you add the animation finished to the animation player
func _eatingAnimationFinished():
isEating = false
#and then in the intergrate forces function
if on_floor:
if isEating == true:
playback.travel("eat")
elif abs(lv.x) < 0.1:
playback.travel("idle")
else:
playback.travel("walk")
hopefully this works :)