Are you on a Windows computer?
Is that all there is to your script?
In windows computers, if you have windows maximized--a setting that maximizes all your FileMaker windows, then opening a new window drops the existing windows out of maximized state. The windows will resize to whatever window dimensions were last specified before windows were maximized and this can be very irritating and confusing for your users.
You can't keep this from happening, but you can use Move/Resize window to adjust the window sizes out to the dimensions of your screen using the Get ( ScreenWIdth ) and Get ( ScreenHeight ) functions as parameters in the Move/Resize window script step.
Then, when you close the smaller window, you can use adjust window to put all your windows back into the correct maximized state. Using FileMaker Advanced, I set up the small "dialog" type window's layout with a custom menu where the Close Window menu option performs a script instead of the standard close window action. That script both closes the windows and adjust the remaining windows back into maximized state. That way, clicking the close window control or pressing it's keyboard shortcut automatically remaximizes the windows.
There is an alternative that has its own set of challenges and that is to not have your windows maximized in the first place.