Drug abuse is a cycle. Addiction has specific triggers and a way it functions; inevitably it seems to lead back to the act of using to escape bad emotions. It seems like you really want to quit, but are struggling for control over your body and mind and it seems to be giving you a lot of frustration. This frustration can often lead to use being hard on ourselves for not being able to live up to the standards of the life we want in the "now". I do not directly see myself as an addict so I cannot fully relate to your situation but what I can say has helped me cope with psychological anguish and very sad/traumatic parts of my life, is mindfulness. Becoming aware of my triggers for unhappiness, being aware of the cycle that causes my mind to run into the ground without self-judgment is what started me on the right path towards healing. Practice mindfulness meditation and learning to accept your emotions but control your actions. It will help you become aware of cravings and how they affect your mind in an objective way.
There are also many other tools you should utilize; TDS and sober living have great support threads with people suffering similar to you and allows you to share your experiences.
I think you should also try to talk to your family...relationships can be rough and I can't even begin to understand yours but having a support network of family is one of the best things an individual can ask for. They are the best non-judgmental support network to have, however I know everyone is not so lucky to have that. Healing began with my family when I Was able to relate my problems to them without fear of judgment or losing them.
Sorry I can't say much about the "science" of it, this is just my perspective of the psychological battle of life. I believe everyone is capable of escaping addiction you just have to keep fighting and not push loved ones out of your life. You are more able than you think, so get rid of that self doubt!