Hello and welcome
I am so sorry your baby is having this problem.
Congnative dysfunction will most often cause symptoms such as barking at night for no reason, trying to squeeze in small spaces,pacing, isolating themselves etc. alot of which you have already seen with her.
I would lead more toward a pain response with the moaning ,groaning, and trying to bite you.These are more pain related I believe then the congative dysfunction.
She was given tramadol which is a fairly strong pain medication so your vet must think something is causing pain. I would talk to your vet and ask if there is another pain medication that may be helpful.
Anipryl is a drug that is often effective for congnitive dysfunction it may be worth mentioning to your vet.
I would recommend having your vet take a quick peak to make sure there is not something causing her pain. It is possible that you vet may just allow you to come get a different pain medication to see if that helps.
I hope this has been helpful.Please reply back if you have additional questions or concerns.