Well you need to use a Boolean flag to prevent the execution of job related script. Here's an example where I use a boolean flag and a loop to unset the flag when the key isn't pressed.
PHP Code:
//#CLIENTSIDE
function onKeyPressed() {
if (keydown(4) && !this.keydown) {
this.keydown = true;
doJobStuff();
setTimer(0.05);
}
}
function onTimeout() {
this.keydown = keydown(4);
if (this.keydown) setTimer(0.05);
}
function doJobStuff() {
player.chat = "shoveling dawg";
}