Felix and Ronald_Reagan are right, movement functions/weapon switches/etc. only work when used with a keybind. So if you put any of those into a sleep (even if the sleep itself is keybound) it won't work.
Ex:
[cubescript]bind W [sleep 0 forward] // not gonna work with vanilla clients
bind W forward // should work fine
bind J [weapon 1; onrelease [weapon (currentprimary)]] // switches to pistol fine, but never switches back to primary onrelease[/cubescript]
Movement functions/weapon switches and such must be executed as the result of pressing a keybind to work. (i.e. instantaneously) By putting them into a sleep/onrelease it breaks that "rule".
Ex:
[cubescript]bind W [sleep 0 forward] // not gonna work with vanilla clients
bind W forward // should work fine
bind J [weapon 1; onrelease [weapon (currentprimary)]] // switches to pistol fine, but never switches back to primary onrelease[/cubescript]
Movement functions/weapon switches and such must be executed as the result of pressing a keybind to work. (i.e. instantaneously) By putting them into a sleep/onrelease it breaks that "rule".