Two things:
First off, your attachment is not a proper Plus! script file - you have simply renamed the .js to .plsc.
To make a .plsc file, you need to create your .js, then create a scriptinfo.xml and add these to a .zip file. It explains how to correctly create them in the
Scripting Documentation.
Second, (after having a quick look), all you need to do to fix your script is add an extra } at the bottom (you have missed it off the end of the function)