So sorry to hear you are in pain, LilBear. By now you've probably experienced the worst & will soon be on the road away from Flaresville. Our bodies have an amazing capacity to rebound.
Sometimes I think pain itself can cause a stress reaction in our bodies & brains that puts us further on the downward spiral. (This is my life, circling the drain

). BLL has made many helpful suggestions that will help you cope with the stress of pain.
Be proactive about getting some pain relief -- that will also reduce some of the stress. Phone your doc for a different class of med than the one that bombed. Explain your reaction. I always get a partial fill (2 or 3 days worth) of new meds because I metabolize weirdly, have had many adverse drug reactions. I save money with the partial fills.
Have you tried sleep meds like Ambien or Lunesta? Sounds to me like a good sleep would be a nice place for you to start. Maybe you could ask your doc, like the commercial instructs us ...
In the meantime, can you crawl into a tub to soak? (there are times one can't ...) A warm soak w/Epsom salts has given me many a temporary reprieve from the worst of the flares. The magnesium in the Epsom Salts promotes relaxation ... it's a nice thing to do before bed. I also like BaTHerapy salts which have both sulfur & magnesium, other goodies. I've seen them at most dept. stores like KMart, Walmart, Kroger/Fred Meyer. Not a cure, but something that helps a little for an hour or two ...
The best $20 I spent at RiteAid was for a microwaveable "moist heat" pad. The warmth penetrates rapidly & brings temporary relief. The pad stays warm for quite a while, so you can move it around. I make a game of it, try to find the most painful spots & make them feel better. Sort of like Bingo.
Pain that intensifies on lying down can sometimes be reduced with a different pillow (higher/lower/softer/firmer) -- or sleeping on somebody else's bed for a night. Don't ask me why, maybe our bodies get bored ???
Take a multivite & eat nutritious food. It will help, but I know it is hard to cook & impossible to shop when you're in pain. Treat yourself kindly & respect your activity limits right now. That will help you heal.
Best wishes.