You might see if the Adjust WIndow [Resize to FIt ] option works for you first.
To see the results of these fields:
Put them in as watch expression in FMP Advanced's data viewer.
Put them in unstored calculaiton field expressions and put the field on your layout.
Use a script to show a custom dialog and put an expression into the custom dialog that uses these two functions to display window size.
The Script step; Adjust Window [Resize to Fit] is in the original script and I'm not familiar with the use of FMP Advanced's Data Viewer.
I'm not sure if I'm following the next part of your answer or not, I think I attempted what you've suggested with the custom dialog and it failed because I didn't know the proper script steps to input an expression.
You actually should use get ( windowwidth ) and get ( WIndowHeight ) if you want the dimensions of the current window rather than the monitor screen dimensions.
IF you have FileMaker Advanced, you really need to learn how to use the data viewer as this is a very useful design and debugging tool.
You can put Get ( WindowWidth ) & "|" & Get ( WindowHeight ) into the show custom dialog and when you run the script you'll get the window width and height separated by the | character. Other expressions are also possible.
You can also define calculation fields with these functions and use storage options to specify that they be unstored calculations. Then you can just put them on your layout to show current window dimensions.