WOW, I don't have any wisdom... all I can say is... that sucks! REALLY SUCKS!
Try to do what you can to get through IM training and the IM with it. Maybe you should try a walk/run combo? I'm doing a 5 minute walk, 2 minute run comb on my longer sessions. It's works nicely and I keep around a 11:30 minute mile. Not blazing fast, but at the IM, when others are walking, I'll be zooming by.
So hopefully the surgery will fix the problem. Right? If so, then that's great! I would say there is a silver lining... ya know?
Well hang in there as best you can.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather, to skid in broadside thoroughly used-up, totally worn out, and loudly proclaiming: WOW WHAT A RIDE!!!!"