I wish I had a useful answer! I've tried everything suggested here and in similar discussions already with my mother, but once she's set her mind on leaving it takes force to restrain her, and that definitely doesn't help. Which is how we can end up wandering the town centre at 4am, or waiting for a bus which -- thankfully! -- never comes at 1am. If it's during the day we can end up on the bus to her old home, ten miles away, trying to find her father, who died 40 years ago. It's heartbreaking and exhausting in equal measure.
Fortunately cold, weariness, or disappointment eventually wear her down, or she starts to worry about the dog (the poor thing has to follow her everywhere whether it wants to or not). So we usually get back safely to her 'miserable prison'. But it's the first time in my life when I've wished I had a car so we could drive 'home' until she fell asleep or I 'got lost'. Not that I could afford to run a car on what I can earn now, but it'd be worth every penny of going bankrupt if it worked.
I have had limited success with using lorazepam to calm her when she gets particularly agitated, but that's a risky strategy because if she insists on leaving and is wobbly on her feet she could end up stumbling, as happened on Boxing Day after I'd resorted to chemical assistance to avoid being Boxed again. I got lucky then because the scuffed knee made her leg ache, making it easier to get her on the bus back here again... I was going to say 'home' again, but these days even I've started to wonder where home is!
What's making life tricky at the moment though is that on top of wanting to go back to her childhood home, Mum's now started to want to find *this* address, believing that we're not really here even after I show her the street sign. We have to walk into town then get the bus back along the route we've just walked so that she's following a familiar ritual to get here. Then when we arrive she ends up disappointed that it's just the same as when we left. I've toyed with letting her wander while I rearrange the house and slosh on some paint to make it look different, but... But clutching at straws can become a full time and totally useless hobby for carers.
Still, you've got to cling to something amid the wreckage of the sinking ship. Anything to keep you afloat! I'm currently clinging to a Tesco Triple Chocolate Cookie and can feel my teeth rotting and my arteries hardening even as I type with sticky fingers.
Good luck.
Andrew... waving, not drowning, probably ;-)