The key to successful sex on opiates is moderation. And with drug users, moderation rarely is an option. However, if you can control your use and are anticipating sex, the right combination can make for a hell of an evening.
Initially, I would not use on the days I was planning on getting laid, because sex without orgasm (especially for males) is frustrating and can often lead an unsuspecting female to think that you don't find her sexually stimulating enough for her to get you off. And women know that it doesn't take much to make a guy cum (a *preferably* wet hole to thrust into is all we need, right guys?) and when she can't get you off, she takes it personally. Not good for your future chances for a piece.
I've found that if you want any chance to cum at all, you need to give yourself about a 3-6 hour cushion between using and bumping uglies. That gives you sufficient time for the dope to have worn off enough that you'll cum eventually.
Might take a while (you're looking at at least 30 minutes and up to 2+ hours, depending on how long until fatigue sets in and you lose your erection due to exhaustion if you still aren't able to get off), but that 3-6 hour cushion is usually solid for me. If I do it any sooner, there's no chance of me getting off before my erection fades. If I do it after 6 hours, the drug has worn off enough that its effects on my ability to get off normally are (while still a bit noticeable) minimal.
However, starting an intimate sexual relationship is as good a reason as any to use as a launchpad to stopping opiate usage entirely. Good sex is better than any high and is free. Also, during withdrawals, having a lot of sex can help you through that rough time. Trust me.