Use the OnViewChange trigger to run this script:
If [ Get ( LayoutViewState ) = 2 // layout is now in table view ]
Do your window size change here
The script will be performed any time the view changes, but doesn't actually do anything unless the view changes to table view.
PS, if you find yourself asking "is there some way to get some info about the current state of my File/layout/record? Open up FileMaker Help and check over the Get functions. There's a decent chance that one of the options for this swiss army knife type of function will do what you need.