Thanks very much, Tharwat and Lee Mac. After a lot of head scratching I think I understand at least part of what each of you wrote.
I got my custom command to work using Tharwat's function. The user has to press Enter instead of the second point, in order to then be able to enter a number to be used for the rotation angle. I was hoping the user could just enter a number instead of picking a point, as is the case with the built-in Rotate command. But this is really not much different.
Lee Mac's function does allow entering a number instead of picking a point, without a preliminary Enter. But I can't seem to use the number as a rotation angle, maybe because it's a text string instead of a real number. Is that right? If so, can the text string be converted to a real number?