We need to clean up the mess and prevent more being added at the same time.
It is not like we can only do either preventive or reactive.
Here are some pages covering various uses by the NHS
Most relevant to the point I made, here is a pricing page for diamorphine for the NHS[1].
Use during birth: [2]
"This is an injection of a medicine called pethidine into your thigh or buttock to relieve pain. It can also help you to relax. Sometimes, less commonly, a medicine called diamorphine is used."
Use in NHS Scotland [3]: "Unlicensed intranasal diamorphine has been used in the NHS in Scotland for the treatment of severe pain in children in the emergency setting. The availability of diamorphine hydrochloride nasal spray (Ayendi®) provides a licensed preparation."
Article on recent-ish supply problems[4] due to a problem at one of the manufacturers:
"NHS trusts forced to use ‘expensive’ pre-filled diamorphine syringes to manage ongoing supply issues
Exclusive: Birmingham Women’s and Children’s NHS Foundation Trust has had to source pre-filled diamorphine syringes from other NHS trusts to meet demand."
NICE advice on diamorphine use [5] lists indications and doses for acute pain, chronic pain not currently treated with a strong opioid analgesic, acute pulmonary oedema, myocardial infarction.
NHS patient information (word doc) [6] on the shortage: "Diamorphine is licensed to treat severe pain associated with surgery, heart attack or a terminal illness. It is also used for the relief of shortness of breath in severe heart conditions. In addition, a small number of people in the UK may be receiving diamorphine to manage heroin addiction."
So while I have no idea about the actual volume of use, as you can tell the NHS has suppliers, and NICE has a price list.
[1] https://bnf.nice.org.uk/medicinal-forms/diamorphine-hydrochl...
[2] https://www.nhs.uk/pregnancy/labour-and-birth/what-happens/p...
[3] https://pharmaceutical-journal.com/article/news/nhs-trusts-f...
[4] https://www.scottishmedicines.org.uk/medicines-advice/diamor...
[5] https://bnf.nice.org.uk/drug/diamorphine-hydrochloride.html#...
[6] https://www.england.nhs.uk/south/wp-content/uploads/sites/6/...
Most people don't develop debilitating drug addictions without underlying problems. Even most people with drug addictions don't get to a point where they can't hold down a job or have a need to carry out crime to fund it, but of those who do it's worth considering why when e.g. a typical heroin addict can hold down a job and could have funded their addiction for ~$20/day if they had access to clean, medical grade heroin (we know the price, because e.g. the UK NHS buys medical grade heroin for use for post-operative pain management - under the generic name diamorphine).
So there's a long path there from failure to address mental health issues and other social problems, via failure to provide safe, clean supplies and early intervention for those who still get addicted to drugs, failure to regulate healthcare properly (e.g. the prescription oxy -> black market oxy -> heroin recruitment path), and failure to ensure availability of jobs, and lacking welfare options, before worrying about treatment and emergency housing is even in the picture.
Start addressing root causes and a lot of the problems later in that chain would either go away or at least be substantially diminished.