WhileLoop and Infinite Loop

You are executing a new conditionally infinite loop every tick.

You should almost never use loops in game code. The main loop handles most looping needs. The exceptions are latent actions and arrays.

I am assuming you want to sprint for a maximum time(5 seconds). Wait some period of time(25-30 seconds) then be able to sprint again.
The following image shows exactly that.

The delay is a latent action that resets to walk mode.

You can add another branch between pressed and the waiting branch to permit multiple sprint-release-sprints in the same 5 seconds:

 if colldowntimer >= 25  
 true sets maxwalkspeed to 1200 -  no further connection 
 false connects to the waiting branch