Hello, sorry to hear that Stormy has a few issues going on.
First lets discuss the sheath swelling. There are a number of causes to edema in the sheath. Often times the edema comes from an area of inflammation higher up the leg. Edema is essentially fluid accumulation. Gravity has an effect on fluid accumulation under the skin and it moves down to the lowest, most dependent area which in that region is the sheath. As the swelling increases it applies pressure onto the lymphatic system which is responsible for picking up the extra edema, thus making it harder for the body to reabsorb the fluid. When the sheath is swollen it does trap moisture and debris internally creating more smegma. Depending on the skin color of Stormy's penis, the color of the smegma can vary. Light/White skin can create a white to pink/red color smegma due to the porphyrins and proteins in the cells. Darker color skin generally creates grey to black smegma. If Stormy is not dropping fully to examine the penis, explore the urethral recess for "beans", evaluate the urethra for habronema lesions, or other wounds or growths on the penis (all of which can lead to edema), then sedation may be needed. This would require a visit from Stormy's regular veterinarian. Cleaning the sheath and penis is a bit personal for the horse, and they often times retract the penis without sedation when attempting to clean the area.
Typically HYPP, PSSM, or exertional rhabdomyolysis (all of which can be described as "tying up") are short periods of time. They do not cause a chronic or long term lameness. They occur with or shortly after work, then resolve over 24-48 hours. As you are noting a chronic lameness and muscle atrophy, I would not expect these to be the cause of Stormy's lameness.
When I see muscle atrophy of one side of the pelvis/croup area I am suspicious of a possible pelvic fracture. Examination by your veterinarian can help to rule this and other possible in or out. If the muscle atrophy is in the quadriceps muscles, then I would look at the stifle as collateral or cruciate ligaments, or meniscus injuries can cause the horse to load the leg in a different way, unloading the quadriceps and leading to atrophy.
Using an anti-inflammatory like bute can help to reduce the inflammation and reduce the swelling, but until you know where the injury or source of inflammation is, you can't know the best way to treat or what the possible recovery period may be if possible.
With what you are describing, I would recommend having Stormy's vet out to assess a few of the areas a bit more. Looking at Stormy's lameness and assessing for Pelvic or stifle issues, giving sedation to get Stormy to drop to allow for a better examination of the penis and urethral recess.
I hope this has helped answer your question. If you have any questions, please don't hesitate to ask.