I suggest to look into the community module ZonePlus. It accurately detects when a player enters and leaves a zone.