The first method that comes to mind is to create a local variable and start a timer every time you press the directional key and once the timer runs out you change the local variable.
You start the local variable with "no dash" and when you press the directional key for the first time it will change to "dash possible".
After the timer has run out the variable will change back to "no dash".
While dash is possible, pressing the directional key again will trigger the dash function.
You will have to make this for every directional key if you plan on being able to dash every direction.
The timer will of course be very small around 1 second.
Hopefully this helps you in the direction of what you're trying to do.