It's easiest to do it in Periodic Tasks like this:
You must use different code in Teleop, because loops should not be used there.
Essentially, you would take the current time, add your delay to it whenever the button is pressed, then separately check to see if the time less than your target and set the motor speed accordingly.