Very sorry you are in so much pain. Endometriosis is one of the most painful conditions we can go through (even when its mild) and sadly still not understood well enough by some drs although it is improving its very slow.
Its best to take pain relief regularly if you are having a flareup or if a period is starting as you need to get ontop of pain not try to catch up.
Have you got just codeine on its own? The cocodamol which is paracetamol as well as codeine is often better you can take the lower strength which has 8mg of codeine per tablet or the stronger one that has 30mg codeine per tablet. Just keep in mind that codeine is often constipating and constipation is not good in general and can make endo pain worse.
Other anti inflammatory meds such as ibuprofen can be taken with cocodamol but not with mefanamic acid. There is also a patch called versatis which you may be able to get from an understanding gp/gynae, its lidocaine 5% which is an anaesthetic and it does help. You wear a patch for 12 hrs and then throw it away and have 12 hrs off them they are not the same as some morphine based patches they are different so just check your gp/gynae hasn't assumed that as some do when they are rushing.
Other than these you could try tramadol or a small dose of oramorph for when you are in extreme pain, again you need gp to prescribe.
Have you tried other things such as tens machine acupuncture heat patches?
Hope this helps a bit I've been there know its so debilitating.
Let us know....