His chronic pain may not be physical. Opiates are very beneficial for many people in emotional or psychic pain. In a sense, of course, I suppose that could be considered a physical condition, since it is related to the opiate receptors in the brain and their lack of proper functioning.
Some people with depression or anxiety problems can benefit immensely from opiates, because their brains need supplementation to make up for something that is not working right. It is no different from applying lotion to fix dry skin, or installing a cast to fix a broken leg. Injesting opiates can fix something that is wrong with another body part -- the brain.
As far as I know, Rush is alleged to have taken hydrocodone and oxycodone, not codeine. I may have missed the complete list of alleged drugs, however.