Jaydee, unfortunately what you're seeing is how the window selection works. It selects everything inside the window, but ignores the case where a portion of that entity is off-screen. Usually you notice this with blocks, but it could also happen to text, regions, solids, hatches, etc. Basically anything which need not be continuous.
The only way to ensure this doesn't happen is to zoom extents before performing the window selection. But obviously this might be very difficult on large drawings.
Mind you, seeing as you're doing this in the lisp forum, you could always manually then exclude those entities which has a bounding box outside of the window coordinates.