The following program gave an error until today but now works as expected -- that is, "13" is printed, then the program waits for a click, then "23" is printed, followed by "done".
box()
def f(x,y):
print(x)
scene.pause()
print(y)
f(13,23)
print('done')
You can even put such things as pause and waitfor inside the methods of a Python class. The only limitation is that GlowScript will get confused if you have an ordinary function containing a pause with the same name as a class method containing a pause.
If you write your program in JavaScript or RapydScript, the use of the "wait" keyword is no longer necessary (it's optional, so existing programs that use "wait" will continue to work).
Bruce
P.S. I'm deeply chagrined that it took several years to see how to do this.....