First off, I'm so sorry you're in pain! I have had multiple spinal surgeries myself, and I know how debilitating that kind of pain can be. Secondly, congratulations, you have discovered one of the rarely-discussed but extremely real benefits of orgasm: pain relief! Before my last surgery, when the pain was unbearable my Magic Wand was never out of reach. But don't just take my word for it! According to Barry R. Komisaruk, PhD, of Rutgers University, “Orgasm can block pain,” This is due to the release of oxytocin and subsequently endorphins, the effect of which is said to be similar to morphine. Komisaruk's work also offers an explanation for why you find edging effective. In discussing stimulation without orgasm Komisaruk says, “We’ve found that vaginal stimulation can block chronic back and leg pain".
So, yes, this is absolutely a thing! Take good care of yourself.