I ran the above script after I added a first line after I read the help file, as my screen looks a little different from the one you posted which has anothe row above the script Edit, Script Type Jscript etc.
@script jscript
But I got the following error message.
Error at line 3, position 10
Function OnClick(clickData)
^
Expected ';' (0x800a03ec)
Parse error - script aborted
Keep the @script line but delete the rest, then try pasting it in again from the original text above.
It looks like it got pasted when in VBScript mode, which changed the capitalisation of things like "function" to "Function", and JScript is (annoyingly) case-sensitive.
It looks like you have an errant character (a space or a tab, maybe) on the end of the @script jscript line. Notice how the pasted error message has a gap between the t and the final quote: