Just hold down enter while walking using wasd to run And yes the if key enter pressed block is an illegal scratch block
The more speed you have, the slower the stamina regens