Hi Rita
Normally I would say check the Start SAP GUI, but you have that.
I can't run this script, so I don't know what happens when you try to configure the product. The issue may be there, but again, not certain.
One thing I noticed is that the end of your loop included the screen name of the last screen to save. It should look something like this: 
Please give that a try and see if it helps.
Best Regards,
Sigrid
------------------------------
Sigrid Kok
Precisely Software Inc.
------------------------------