The new window command does not have an option for specifying a layout for the new window. Instead, you open the new window to the current layout you have open and then use subsequent script steps to specify a different layout and change any other layout options such as the view and status bar to get what you want the user to see.
Thus, that new window will trigger an OnLayoutLoad event on the current layout when you first execute the New Window command. It's "loading" the layout in the new window. You can keep this event from having a effect on your database function by setting a global variable or field and then modifying your triggered script to check the value in this field or variable to determine whether to execute the rest of the script or to just exit.
Awesome not only a timely and clear explaination but a suggested work-around!