As someone who did a ton of sleep walking as a kid please do not put a gate at the top of the stairs that is incredibly dangerous, even the one at his door isn't good. The list of ways to help prevent it from happening is a good list to start from. For many kids it stems from being over stimulated or over tired when going to bed.
Not sure the area you live in but I'd encourage you to turn the motion off. the chime is a interesting idea. It would help create scenarios where you 2 can encourage him to go back to bed without waking him. Maybe a stop at the front door as well. personally, I was notorious for trying to make food, standing at the refrigerator, putting on clothes/shoes, and going for the front door and a ton of talking.