You're in an extremely tough place regarding weighing your options and finding one that will have less risks over the long-run.
I'm not understanding what a cavity in your lung is meaning....would you mind to clarify that for me?
In truth....I'd prefer surgery, long before the meds you've already tried..,.but that's me. It's not the majority who've had surgery.
I read very few who've regretted having it. Yes, some have had complications and required more surgeries and recuperation time, but they've healed and moved forward to function without UC, the meds and ill health.
You should seek out information on the ostomies forum as well. Remember that not all have UC on there, so complications will vary as will healing, etc.
You've already been through an extremely rough time...and while your fears are totally understandable and normal...your functioning now seems to be more crippled than you would be after surgery.
Seek answers, ask more questions and prepare yourself for the process. You will have tons of support from HW, both here and on the ostomies. Try not to believe that you'll have a worst case scenario....there are many possibilities before that one.
Hang tough....remember the strength you've got and believe that while it's normal to be scared...through information seeking, you'll be better prepared emotionally going through the process than you will be when forced out on a tightrope with no supports available to draw from.
Huge hug your way!
q