Actually Tramadol is known to cause addiction (and hence withdrawal) issues for some dogs. Codeine is pretty mild as an opiate and would probably be less worrying in that regard than Tramadol. But really, best thing is to talk to a vet or neurologist for pros and cons of any drug. All drugs have some side effects and benefits may well outweigh any issues -- and side effects do not tend to happen to every dog, just to some.

Unfortunately there are not a lot of choices for managing some illnesses, SM being one of them. None of the medications is great for long term use. So selecting what works best is highly individual and needs to be based on lots of different factors, in discussion with a medical professional.