Thank you for your post.
Divide your script into two parts. The first part ends after displaying the layout with the Web Viewer. Then, on the layout with the Web Viewer, create a button that executes the second half of the script. This way, the first part of the script runs until it displays the Web Viewer. The user can then continue by pressing the button to continue on with the remainder of the script. Does this make sense?
Please let me know if you need clarification for the above steps.