Hello N..
You have a bit of advise here. I'm not certain if you have answers you were looking for.
Your conscious might rest more easily if you do pursue the door latches that were mentioned, or some other kind of alarm device that would let you know whether or not the door had been opened. That will not help you when it comes to having to allow your child to travel or go somewhere where he is not under your supervision, unless the device is small enough and easily enough to install and remove to be taken with you or your son, and your son will take responsibility for its use. At 12, it would be isolating to feel "different".
You might consider consulting your son's pediatrician regarding the situation. He or she may have some advise to help you as well. Personally, I would be very leery of anyone offering to medicate your child for this, medically certified, homeopathic or otherwise. It seems counter-intuitive to me to believe that a parasitic infection would cause anyone to sleepwalk. Just not the same two affected systems functioning, medically speaking. I can quite assure you that neither my sister nor I was ever treated for parasitic infection in our lives, and both of us were sleepwalkers into our teens, and randomly even older. I would confidently say the same is likely true of your spouse and his brother, though you might check.
With regard to what triggers sleepwalking episodes, you might try some web research. I know in both my and my sister's cases, we walked under stressful situations; travelling, moving, at the start or end of school years, when there was school testing, sunburns. In my case, I was still sleepwalking on occassion into my 20's, each time associated with a stressful employment situation.
I believe your spouse and the others who mentioned it are correct, your son will grow out of this behavior. In the meantime, you are a very conscientious mother to be looking for ways to keep him safe during that timeframe. I would be too. Do not take your instincts lightly, despite your inexperience with sleepwalking. If you are not confident in the situation for your son's safety, then best to forgo it until you can be or come up with an alternative that leaves you, as his parent, responsible for his safety. You only have one son, and he is one of a kind in this world.
Hang in there, and good luck.