You say you’re using estrogen therapy, have sufficient lubrication, but are experiencing pelvic muscle spasms that cause you some discomfort during sex. You’re wondering whether being sedentary contributes to the problem, and whether a vibrator, which your doctor recommended, may help.
It’s unlikely that sitting too much would contribute to the muscle spasms (although as a doc, I need to recommend more physical activity). Unfortunately, most of the time we don’t have a good explanation as to the cause of muscle spasms. A vibrator works by increasing (through stimulation) blood supply to surrounding tissues, which, in turn, promotes vaginal health. If you choose a vibrator, make sure it’s one you can use internally, not just externally on the clitoris.
The other tool that’s often helpful with muscle spasms is a set of vaginal dilators. These are designed to provide a gentle stretch to pelvic floor muscles to reduce spasm.
I hope this is helpful! Part of the solution is to be confident you can address the issue.