User blog comment:Alixgirl11/Getting NPCs to Stay in their Houses?/@comment-173.81.182.198-20111216230801

You could use active stone block doors in front of or behind his door, and connect them to a lever or switch.