I've been searching the internet for about an houe now, and i cant find any clue how to fix this. The script itself is no problem, just the command / way to make scroll lock flash.
You can use /sendkeys to change the keyboard LED states, for example: /sendkeys [color:green]{SCROLLLOCK}[/color]
There's also useless.dll, but that requires a .sys file to be installed and is probably overkill. It does avoid changing the actual state of the locks, though.