Duplicating a Microsoft Dexterity window on the same form - Part 1/2

Just today, I was trying to solve a problem that at first seemed very simple: I needed to duplicate a Microsoft Dexterity window on the same form. Background To provide some context, I have a Dexterity form which hosts a modal window that needs to be displayed in middle of a process - we will call this window, window B of form B. Form B implements an OpenWindow form script that serves as an API to any calling script. The OpenWindow scripts implements a parameter that allows the modal window to either wait for user input or continue processing automatically (that is, without user input), which in turn would close the modal window (and the form) upon completion of all processes executed by the OpenWindow script. To make matters more interesting, one of the callers happen to be a script on another modal window in another form - we will call this window, window A of form A. Now, when this code (and process) is performed from the Microsoft Dynamics GP desktop client, everything occurs...