Hi, I'm so sorry you are going through this.
I have 3 dogs and have had dogs pass in the past and any I have lost have actually been quick or accidental deaths so I have never had to think about palliative care with them.
However I did have to do that with my 19yo cat who developed dementia and seizures.
I don't think this is what you want to hear but if your lovely dog is on that staggering amount of pain relief and is unable to gain weight (my assumption from that is that it would be good if he could, so he is underweight) and unable to get around himself now I would be looking at doing the kindest thing we can do for the little ones we love and letting him go to sleep in a controlled environment.
You have given him 13 years of a good, happy, independent life and for him to spend the end of it being carried around whilst spaced out on painkillers is not the best thing for him. That's the reality of your plan, he will be drugged, in pain, confused and unable to do the simplest things he has done his whole life. He won't understand why.
Please do not think I am criticising you for thinking this way. I understand that drive to keep our best friends with us and that human emotion of 'he may need painrwlief and he can't mobilise well but he is still here' but the only life he has ever known is one being pain free and running about like a lunatic (i have a shihzu, i know!) and he doesn't have that ability anymore.
In your shoes I would book an appointment with the vet to put him to sleep and have a week of absolutely spoiling the heck out of him. Take him to the beach. Take him to Pets at home and let him choose any toy. Go to McDonald's and buy him a double cheeseburger 🤣 and take 50 photos a day.
I kept my 19yo cat alive too long. I couldn't face the truth of what was happening to him and in 12 hours overnight he deteriorated to the point that he had an awful last few hours and his euthanasia appointment was much more traumatic than it could have been if I had made the right decision a few weeks beforehand.
Again I am so sorry you are in this situation.
Sending you so much love 💐