Now, when moving the square to the top boundary and the left boundary, it works better; stopping movement closer to 10 pixels in from the window's edges. But when moving the square to the bottom and right edges, the square trails off the screen for quite a distance.

If I write: 'if pSquareX >= 690:' instead of 'if pSquareX >= 790;' it works more like it should (for the right side).

It's got to be something simple, but what am I missing here? Why don't the right and bottom dimensions match up with the window size I specify? It's more like the actual display object created is 800 X 600, but the window created when the program is run is 700 X 500.

You may be interested in the functions pygame.Rect.clamp and pygame.Rect.clamp_ip. They allow you to constrain one rectangle to another rectangle without explicitly needing to state your bounds with inequalities.

As he said, you are not taking into account the width of your sprite. You are blitting by the coordinates at the top-left corner. This means as you have written it, it is the topleft corner that won't get any closer than 10 pixels.