That is because when the application is actually open the data frame window has a defined size. But when you run a stand-alone script, the application isn't actually open, there is not a real point of reference and depending on your system settings, you may get different results on diferent machines. Using a page layout that has a defined page space whether open or not, you will get consistent results.
Also - defining a page layout size and fixed dataframe size on the layout you will get consistent results. Otherwise when you resize the TOC, the application, etc, the data frame size will be different. etc, etc,
Jeff