Technology has advanced but I would guess by your history you have pretty much destroyed the ligaments around the shoulder. Orthopedic surgeons are doing arthroscopic surgery but you will probably require an open repair to get the best results.
The most important thing you can do before this surgery is meet with the physical therapist to learn how to do the rehab exercises. After surgery really push the rehab. It usually takes 3 months of good, hard rehab to gain full motion of the shoulder. (Been there, done that!)
As far as flying, it depends on the equipment you operate. If you are not in a cockpit with overhead switches, you can probably be back to flying in 6 weeks or so. If you have overhead switches, like in a 737, it may take 10-12 weeks to get there.
Best of luck to you.