Understood. The valium can be a bit sedating, which would actually exacerbate the ability to walk.
Yes, I do agree that with any underlying joint issues, advanced arthritis, etc...Tramadol would be a suitable pain medication to help. However!
What you really need for the joints is a good non-steroidal anti-inflammatory like Rimadyl or Metacam. A NSAID may have a substantially bigger impact on overall mobility than Tramadol.
Tramadol, can also be sedating sometimes, which may not be advantegous.
Another thought is discussing with the vet about using Gabapentin instead.
Tramadol, recently, has been losing some favor because it has poor bioavailability when ingested. So, some times, it really needs to be given at higher doses to actually have benefit at reducing pain. Gabapentin can actually be more effective under certain circumstances. Just something to discuss with your vet.
So, Tramadol can be used for pain, but you really want to start a drug like Rimadyl for the joints.
Some people may argue that you should start a joint support supplement. However, there benefit can take over 4-6 weeks before anything is observed, so I would worry less about joint support at this point.
I hope that information helps