I'm not totally sure it is the best (or even a decent) way to handle it, but I'd try something like the following:
var dash_timer = 0
var dash_timer_max_time = 1
func _process(delta):
_process_dash(delta)
func _process_dash(delta):
# If the character is dashing...
if (dash_timer > 0):
dash_timer -= delta
motion.x = 500
motion.y -= GRAVITY
# If the character is not dashing...
else:
if (Input.is_action_pressed("dash")):
dash_timer = dash_timer_max_time
That should make it where the dash lasts dash_timer_max_time
seconds long when the dash key is pressed. Hopefully this helps!
(Side note: Welcome to the forums)