I recently spoke to Gyne and Pain Management Team while in A&E and questioned them over the effects of taking painkillers for a long period of time (I've been taking them since March and now take a long list of medication including Tramadol and Morphine). They both said that as long as you're taking the medication correctly (i.e. with food, with a glass of water etc) it won't cause any harm to your body.
My GP kept giving me Norethisterone and it wasn't until I saw Gyne a couple of months ago that I was told that you're not meant to be on it longer than 6 months. I know some women that are on it longer than that and haven't experienced any problems, but it might be worth speaking to your GP/Gyne if you've been taking it longer than 6 months. It might be worth looking at more hormone treatments if you're not on them already? I've had the Mirena Coil fitted and I'm also on Cerazette which is starting to help with the pain.
Sorry if this is TMI but I also had an X-Ray whilst at A&E and they said that I was very constipated which is contributing to the pain and is caused by all the pain medication I'm on. Although I didn't feel constipated at all, the doctors explained that the reason I might not notice any symptoms of constipation is because it's masked by Endo symptoms. I've been given laxatives and eating a lot more fruit and veg and have noticed a slight reduction in pain on my right side, so it might be worth giving them a go just incase you're experiencing similar problems whilst on codeine?
Hope this helps you a bit x