Hey! I tried out just the movement script part of this and found that the buck stopped with moving right if I pressed right first, and it wouldn't take any other input thereafter. So I think doing a list of if-statements like you have isn't doing you any good here.
I found the attached code to be much simpler and functional.
Exchange my "Forward" with "move_up", "Backwards" with move_down", Right with move_right and so on. (I just quickly tested this in a project where I already had an Input map set up.)
I had no problems with the player disappearing just based on the movement, so this is likely something to do with your animations, or triggering the hit function somehow.