I have had experiences with sleepwalking for several years when I was younger, and I found that sleepwalking for me occurs if I did things that were overstimulating, like video games or a really exciting event during the day.
I sometimes found myself running down the stairs to get something or checking on the doors or items. It was very strange because during the sleepwalking, it's like your mind is possessed on that task, even though it seems like you're awake during the sleepwalking.
I think that controlling the stress and anxiety would probably reduce the sleepwalking. Easier said then done, I know, from personal experience.
For your immediate concern about leaving the house or driving a car, perhaps an idea might be to make leaving the house or driving a car require un-subconscious thought in order to do. For example, you might lock your house keys and car keys inside a lock box with a number combination. The thought required to remember the combination and work the numbers would prevent the subconscious mind during sleepwalking from being able to get to the keys. Or more likely, your subconscious mind will know and remember that the keys are in the lockbox at night, and if you do sleepwalk, you won't attempt to leave the house or drive a car because you know subconsciously it's not possible.
Good luck