This thread was really useful for me and helped me to get my JMS monitoring going.
Also to contribute, I took a different tack towards stopping the looping. I found that it was necessary as we were going to be starting & stopping the mock services through a command line, and didn't want to be trying to stop the monitoring by hitting that sleep period.
As suggested above by skarfiol, I gave the soap request a timeout, and the subsequent step a check. If the groovy MOCK script (step 2) finds that the request is empty, it goes back to the soap request in Step 1. I didn't add a sleep command to the script.
In order to stop it, I gave the Monitoring Test Case a property "readyToStop" that starts off as "false".
Back in the groovy MOCK script (step 2), I added a check, so if the Test Case's readyToStop property has been set to "true", then it cancels the test with the reason of "Requested to Stop".
Over in the mock services, as part of the start script, I start the Monitoring test case, and at the same time, set the Monitoring Test Case's readyToStop property to "false". As part of the stop script, it sets the readyToStop property to "true".
So when the soap request in Step 1 timesout and moves to the groovy MOCK script in Step 2, it finds that the property has changed, and it stops. If not, it checks whether the response is empty or not, and acts accordingly.