I would do a state machine and then cycle through those. I am working on a 2d character that has run, walk and idle animations.
enum STATE {IDLE, WALKING, RUNNING}
var playerState = STATE.IDLE
func _process(delta):
match playerState:
STATE.IDLE:
# idle command/animation here
STATE.WALKING:
# walking
STATE.RUNNING:
# running
You can add however many states you want then use whatever logic you prefer to change the Player state as necessary. You can also run the match logic in different functions to keep your animations/commands decoupled (which I'd recommend for your own sanity).