You lay out a reasonable position where it might work. I salute you. That sounds reasonable and I could see that it might work. If it was cheap enough, anyone could get a prescription, treatment was also available, then it would drive down the price so much that there would be little incentive to use the illegal stuff. Sell controllable amounts, that is better than random death, plus random overdose.
The idea being that the heroin market could grow and reduce the demand for the fentanyls and carfentanyls.
Hopefully the addicted would want the safer stuff, especially if it was at similar prices or cheaper.
Then you tax it, and use the money raised for public awareness and education to drive down the rate over time and offer out reach programs, counseling, and rehab services to the people buying the stuff.
That seems like the sanest and most humane way to tackle both having these extremely potent and dangerous substances flying through our mail system while limiting damage over time, and helping as many as possible for whom they’ve already become addicted or are on that path.