There are API docs for URScript, they are located here. The easiest way I’ve found to learn script is to generate a Polyscope file and save/play it. This will generate a file by the same name with a .script file extension. Open this up in either a text editor or your favorite IDE and you will see how they convert what you see on the screen into script.
To be honest it is hard to say on my side what is happening, I have never seen that before. Maybe someone in this community will be able to help you out but in the meantime I would suggest that you contact UR support team. They would probably be able to help you with that.