From reading your post, I believe you are asking the following questions:
1) How do I get the gamepad to keep dashing after the button is pressed?
This is pretty simple. Do a check to see if the player’s velocity is >= a specific amount - 600 for example. If this is true when the player presses the dash input on the gamepad, then switch the the player to a different state called sprinting that changes the character movement’s max walk speed to whatever desired new max speed you want. Now, if the player chooses to stop moving then you want to check if the velocity has dropped below a certain point - like 600 again for example - and if true, then you want to switch the player back from the sprinting state to whatever default movement state was being used before. One simple idea for doing the check that comes to mind is using a gate with a tick function that starts off closed, but opens once players have successfully switched to the sprint state.
2) How do I get the keyboard to dashing only while the dash input is pressed?
This is easier to do than the gamepad press functionality. All you would do is update it the same way as with the gamepad in pressing the sprint input key should switch the player to the sprinting state, and then once that key is released it should switch right back to the original movement state. However, I can’t tell if you are also asking how to make it sprint automatically without holding down an input key for movement on keyboard - like some games have done before.
3) How can I swap between using both controls seamlessly during runtime?
This is pretty simple to do. Just use a bool tell which control is being used. For example, when input from the keyboard/mouse is received then mark a bool such as ‘KeyboardMode’ to true, and set ‘GamepadMode’ to false. And vice-versa with gamepad input.