At the risk of sounding cliche', there is an underlying reason for your addiction. I say 'addiction' singularly because, while they are different sources of addiction, your compulsive desire for sex and heroine dependency are one in the same. By that, I mean they have each served as a way for you to cope with something, but each one doing so independently. Not sure what the something is, but im betting that if you were to dig into your memories from up-to, and around age 15 (when you first noticed your obsession-if you will-with sex). It is very likely that either one of two things happened: 1-your psyche experienced some sort of disturbance or trauma around this time or 2-this same trauma scenario occured, only earlier in your lifetime ,and was suppressed, by age 15 you reached a peak of physical growth and maturity (particularly a biological adjustment in hormone levels) which provided an outlet for you-subconsciously- to cope with the psychological 'trauma in question' by converting a method of supression into a physical method of acting-out sexually.
It is possible that even if this 'addiction' to sex developed initially as a psychological coping mechanism, over the years it could have become more of a physical need than a psychological one. I doubt that is the case though seeing as how you overcame the 'need' to act on impulsive sexual behaviors soon after you were introduced to mind-altering chemical substances. If your need for sex was an innate, undefeatable drive to engage sexually whenever, and with whomever possible, then that addiction would still exist within you. To have this consistant sexual dependency cut off completely when you developed an addiction to heroine suggests that it might not have been a 'sex addiction' after all. If it were, you wouldnt be able to just let it go. [I wouldn't imagine anyways...granted I am no doctor. Just a humanistic-behavioral enthusiest with a knack for understanding the unexplainable]
Moving on. Where was I?
Oh yeah.
So I have interpreted the meaning of your situation to be as follows: There is something within you that is a psychological struggle and you may or may not even be aware of what it is. The sex stuff came about and served as your (subconsious) coping mechanism. This continued strong and unwavering for years, until you discovered another psychological coping mechanism-herion/opiate use. Finding that drugs made you feel good, you no longer wanted (physically) or needed (psychologically) to engage sexually the way you had previously. Your NEED was met by the heroine meaning what you though was a constant need for sex, actually has nothing to do with sex at all. Heroine, being a mind altering substance became the substituted coping mechanism.
So which addiction is better to have? well i would say none at all. but ive had my own struggles with addiction so i know thats not much of an answer at all. The difference between the two is that opiates and any other recreational drug/substances cause neurological 're-wiring', affecting different parts of your brain. Substance addiction is one that may begin as a psychological dependency (a dependency that can be treated and often, overcome) but as a result of the chemical interactions occuring between such substances and the functional structures in your brain, this type of addiction is characterized as a physiological dependency (which is irreversable and treatment is slim to none)
My advice, wean off the opiates. Enough so that, you can handle personal therapy without having to rely on it during the couseling process; which would be my primary recommendation. Nothin wrong with sex though. Its awesome. Stay safe. Use a condom.