It was just your boss sneaking around checking up on you. ;-)
More seriously, working hird shift is tough on people. Even second shift is no picnic.
It messes with peoples sleep patterns.
IMHO, sleep deprivation can cause that sort of thing.
And there is probably some sort of normal survival instincts involved. We have peripheral vision for a reason, yah?
In the ancient past (and in some cases the present), there were survival benefits to being vigilant regarding what's in your peripheral vision.