I think it's definitely a factor.
Impossible to say for sure. Along with the physical detox from opiates comes a pretty intense mental one. It's not at all abnormal for an addict to experience quite a long period of time where their emotions are all over the place.
Hopefully you've realized after this relapse that one is too many, and a thousand is never enough.
Have you sought any kind of professional help for your addiction, and if so, have you stuck with it? That needs to be priority ONE for you...with the anxiety and depression a close second. You cannot really FAIRLY assess your emotional state though without having some significant clean time under your belt (clean from any/all substances), to give your brain some time to readjust to life without the artificial high from the opiates. Alcohol is the very worst thing for anxiety AND depression too.
We have a super addiction forum here...I encourage you to post over there as well:
http://www.medhelp.org/forums/show/77?camp=msc
Good luck to you! Let us know how you're doing!