I am sorry for the loss of your friend. I lost a special friend on this board who died of cocaine induced heart failure. I had never met him personally, but it affected me greatly and caused much sorrow. For you, it has been a friend who you have touched, and shared with and heard each other's laughter. It must be extraordinarily sorrowful for you.
As you try to cope with this huge loss in your life, it might help to know that drug addicts are those who have yet to learn how to cope with thier own life's insecurities and hurts and pains. We hide in a drug to block the painful thoughts that we can not deal with. As you have found, it is a dangerous way of coping and leads to no good ends. Perhaps much of the answer you seek lies in understanding the addict more than the drug of choice.
God Bless you in this sad, sad time. Make this passing of a friend worthwhile in your life... learn from it. Honor his passing by grieving for the person and understanding that this person sadly had not found a better way to cope with life... find your own healthy way.
In hope always