I'm so sorry to hear about your old girl. There are a couple of things that have worked for me and my senior B. Supplements and/or foods with antioxidants can help (SAMe is good), as can play time, exercise and activities that provide mental stimulation and keep her active and engaged. I have also found that it helps to stick to a routine and keep things out of the path they follow. (My old boy follows the same paths, and if I leave shoes or anything in the way, he'll stumble over them.) And DAP helps some dogs– calms them down and stops the pacing.
Also, restlessness and wandering can be a sign of pain-- sometimes caused by arthritis, where it hurts or is uncomfortable to lie down so the dog keeps moving. Pancreatitis is very painful. My dog has had it twice, and both times he wouldn't eat or drink and couldn't keep food down. Does your girl have chronic pancreatitis? Maybe she has a tummy ache or would benefit from a different diet?
One last thought, which probably doesn't apply in your case, but sometimes wandering, disorientation and getting stuck in corners can be the aftereffects of a seizure or mild stroke, which otherwise would have gone unnoticed. How are your dog's kidney and liver values? Good luck to you! I hope your old girl feels better soon!