Oh, sorry I just read the script.
Anyways the only way to break the repeating function is to keep a flag on the key being hit. You can use onKeyPressed() but that has a repeat function based on default keyboard(after a second or so it'll start repeating).
PHP Code:
function onTimeout() {
if (keydown(5)) {
if (this.keydown5 == true) dostuff();
this.keydown5 = true;
} else this.keydown5 = false;
}