Place it just after the unwanted entrance, once the intruder is fully in frame, and let it be the clear turning point of the scene. Lead in with a sudden suspense sting for tension, then follow it with Nelson's Ha-Ha for a mocking finish that keeps the joke on the person leaving.