If you are treating the patient in the context of pain management, then there's not a whole lot you can do, medically, for that patient. And there's not a whole lot the doctors can do either. For example, if the patient is an addict, but is hospitalized for a fracture, or surgery, you have to treat their pain, and their pain is whatever they say it is. If you feel like they're too snowed and are at risk of respiratory depression, that's your judgement, and you do not have to comply with their request (If someone said "kill me now" you would not do it). If they look comfortable, and are able to walk about the floor, and they say they are in 10/10 pain, you've got to do your best to address it (though I'd seek an order that the patient can NOT leave the floor, since they may OD on their own, but technically under your care).
You CAN make an impact on the psychosocial needs though, or at least you can try--which is the best anyone can do. Establish rapport or trust with the patient--that is, make a deal with your patient "I will do my best to bring you your PRNs without you having to watch the clock, but I need you to not go off the floor as I'm concerned about such and such." or "you wear your pboots/stop refusing lovenox as these can prevent life-threatening blood clots". Remind them that you are their to help them stay safe, that you have the knowledge and skills to do that, that it's your job, and it means something to you. If they break their agreement, call them out on it. It's ok to take it a little personally (in a calculated way--it's a little manipulative, but in a non-professional context when someone breaks an agreement with you, it hurts, right?)
If you feel comfortable probing a bit into their drug dependency, try in a very understanding way to get a little bit of their history with drugs (even if they are sticking to the "I don't have a problem, just chronic pain" line). What do they take at home? How long have they been taking it? Have they ever felt they had a problem with it, or been to rehab?
Then, use your resources. If there's an addictions service at your facility, do what you need to get them a consult. Relay all the information the patient has given you to the MD, to the addictions specialist, a social worker, etc. Also, a person who is addicted to opiates and has a high tolerance to pain meds who has an acute pain episode (surgery, etc) warrants a pain service consultation, to ensure you are actually covering this person's pain.
With all these resources, the patient has the best shot at getting appropriate hospital care, and a feasible discharge plan, where you won't be leaving the patient to go into narcotic (or benzo!) withdrawal on the streets.