I'm not sure we have all the information. If it's just one door that swings one way on a hinge then there is no way to tell if it's opening for someone on entry or on exit.
You might use a motion detector just outside the door and the switch. If the motion detector is triggered first AND the door switch opens soon after then sound tone. If door switch opens first then motion detector is triggered tone would not sound. This would not do much for you if you had people coming and going at the same time. Photocell indicators, floor mat switches, etc might serve in place of the motion detector. A pair of photocells, one inside, one outside, might also be used to indicate direction.