Basically, you will have to create a timer, you can find how to create one in the wiki.
https://wiki.alliedmods.net/Timers_(...Mod_Scripting)
And move your logic from "OnPlayerRunCmd" to the timer, inside a for loop through all valid clients (IsConnected)
The only thing you "don't" have ready to use is the client button, but is possible to get that with some basic functions (GetClientButtons)
This is the basis, if you don't know what I'm talking about I believe you won't be able to do it on your own and will need a code "ready to go".
__________________