Ok, I'll spell it out for you:
Life of illegal pothead: Call up dealer, meet at parking lot, buy baggie. Go home and light up. Primary risk factor: contaminated pot, or bogus. Probability: very low. Bogus pot easily detected by experienced users. Consequence of smoking contaminated weed: hard to say. NOTE: The main risk of contamination comes from the US government spraying defoliants to kill marijuana fields in south and central America.
Life of legal pothead: Go to pot shop, buy baggie. Go home and light up. Primary risk factor: contaminated pot, or bogus. Probability: extremely low. Same potential consequences.
Life of illegal H addict:
Wake up in desperation. Try to score extremely expensive, hard to find substance in very dangerous neighborhood while beginning to suffer withdrawal syndrome. After scoring, enter filthy public restroom and draw water from toilet (yes, they actually do this sometimes, I've seen a video of it) into non-sterile needle and syringe. Inject drug without prepping injection site with alcohol.
Risk factors: Acquiring various life threatening infections such as HIV, Hepatitis, etc. due to use of non-sterile and/or shared needles, non-sterile water, and piercing unclean skin. Impurities in drug range from particulate matter which can clog capillaries, to toxic chemicals used to process the opium and not fully purified out, to cutting agents composed of whatever. Also, the concentration of the drug is completely unknown. Addict expects a certain strength. But if it turns out this batch is 66% pure instead of 33%, addict might die of overdose since ratio of therapeutic to fatal dose is only 2:1.
Most addicts can't hold a job and so resort to a life of crime not because it is impossible to function while high on H, but because it's illegal and stigmatized, so no one would employ an addict, and the lifestyle of constantly trying to score makes employability very difficult to maintain.
The illegal H addict is doomed to die of some miserable infectious disease, or overdose, if they don't get clean. Even if they do, a criminal record may prevent them from attaining full social acceptability. Since degree of social integration is a key predictor of tendency to become addicted to drugs, addict will always be at high risk of returning to drug use.
Life of legal H addict:
Wake up and get high using sterile needle obtained at pharmacy, and 100% pure heroin of pharmaceutical quality. No particulate matter, infectious microbes, no needle sharing, no chemical impurities, clean distilled water, use alcohol to clean skin to reduce infection risk to near zero.
Go to work at some job. The main limitation is that an H addict would be unable to operate heavy machinery or perform safety-critical roles. But an H addict on a maintenance dose (not completely zonked) of H can function about the same as someone who takes an anti-anxiety medication.
Purchase affordable heroin at pharmacy once a week for about $10/gram (100% pure), compared to $100/gram (10-90% concentration and highly impure) on the street. Low price and employability makes it unnecessary to steal to afford drug.
Risk factors: Not many. Driving would be a bad idea. But the drug and the injecting under sterile, controlled conditions will not cause a significant increase in risks of shortened life due to serious health consequences. This is not different than the situation of diabetes and other patients who need to routinely inject medicines. If the drug is legal, this will also motivate less use of injection. Addicts will choose to maintain on an oral dose, and only inject once in a while for a "rush."
NOTE: It may seem that 100% pure heroin would be more dangerous than weak, diluted street drug. This is false. The danger comes from variability of concentration, not the absolute concentration. If the concentration is known and fixed, the user can always draw the correct, safe dose.