Koko had recently shown a great interest in the trap door, and to try to convince Koko there's no reason to go down, Qwilleran closes the door behind him, and goes to lunch.
To prevent Koko from entering, Qwilleran shut the door after himself and went to have lunch, as Koko had recently developed a fascination with the trap door.