I'm sorry that your question wasn't answered in a timely manner and I'm sorry to hear of this with Molly. You appear to be describing sundowners syndrome - a form of cognitive dysfunction in dogs and humans. It's conjectured that the dark and quiet of night magnifies the sensory loss in these patients which results in their anxiety and subsequent aimless wandering and panting - indications of anxiety. Other indications of cognitive dysfunction include disorientation, changes in social and interactive behavior - becoming "needier" or, conversely, more aloof - changes in locomotor and sleep cycle behaviors, and loss of housetraining.
Unfortunately, this is a progressive disorder and often vexes caretakers unable to control inappropriate behavior. If additional medical problems exist - brain tumor, e.g. - the onset of seizures may prompt euthanasia. You may find that a prescription benzodiazepine such as alprazolam (Xanax) will be helpful for controlling Molly's anxiety and pacing and so discussing the use of such a psychotherapeutic drug should be discussed with Molly's vet. Morphine mustn't be administered concomitantly with tramadol and so if you want to see how it affects Molly, you'll need to stop tramadol administration but her vet will need to know that you've done so and give you an appropriate dose for the morphine. It varies with the type of morphine you have.
Ancillary care involves physically and mentally stimulating exercises such as swimming, massage, and range of motion exercises, encouraging relaxation, ensuring that Molly is taken out frequently to minimize the cost of elimination "mistakes", encouraging reestablishment of daily cycles by feeding at regular hours and at least a few hours before bedtime, and administering the alprazolam before bed. Specialized diets rich in antioxidants may be of value such as Hill's Prescription Diet b/d. The monoamine oxidase inhibitor selegiline (Anipryl) is the only drug licensed for use for the treatment of canine cognitive dysfunction in the States. Many of us aren't impressed with the studies supporting its use, however.
Cognitive dysfunction in dogs is just as difficult to manage as is Altzheimer's in humans. I wish I had some magic for Molly. Please respond with further questions or concerns if you wish.