A lot of senior dogs develop heart conditions as they age, as you said about the "dry cough, gagging (acting like throwing up but nothing coming out), and heavy panting/restless behaviour at night" are all symptoms of heart failure.
Couldn't say what is exactly whats wrong with the heart, it could have fluid around the pericardium (the sack around the heart) lots of small breed dogs develop mitral Valve Disease, this is where the valve leaflets of the heart don't seal because of wear and tear, large breeds like your Sheepdog have problems with dilated cardiomyopathy where the heart muscle becomes enlarged and out of shape, and unable to function.
I hope this eases your mind?
Best reagards
I totally agree with lindapalm!
I am absolutely HORRIFIED to hear that a vet would say about your 12year old dog "that she is old and may have heart problems or cancer"
That is not good enough.
He might have been rght. But still, without testing no-one could say what was wrong with her, and the "age-ist" views of some vets I look on as stupid and a form of laziness.
In my opinion most dogs are NOT "old" at age 12...not old enough to be written off anyway. They are senior dogs, yes, and they can be sick dogs. But not just an old dog that has to be given up on.
I ca't tell you exactly what was wrong of course. I don't know. And all the tests could have stressed her, and cost you a heck of a lot of money, maybe for you to discover she DID have the late stages of a terminal illness. It is possible -for example -that she had cancer of the Spleen or liver.
I am so sorry. It's a dreadful loss. Hold on to the good memories you had of her, I am sure there are hundreds.
I don't know what your dog suffered from, but I think you need a new vet. His answer to your problem was terrible, he should have run tests to se if there was anything wrong. We had a Sheltie, too, they are such smart dogs, aren't they? Sometimes too smart, you'd swear they were reading your mind. I'm sorry about your dog.