This doesn't work because this if/elif/else statement you have here:
will always call $Sprite.play (since you have an else statement).
That means when you are in the air, you are calling $Sprite.play("jump") but then also calling "walk" or "idle" on the very next frame. So your AnimatedSprite is going to be constantly switching back and forth between two animations, which is why it freezes up like that.
To fix this, you could just put the "jump" call at the top, like so:
// and so on
Hope this helps.