Scotland’s drug death crisis is based disproportionally upon older drug users who began using heroin in the 1980s and 90s under the Tory and New Labour neoliberal economic policies which lauded greedy individualism, and which destroyed communities through a failure to create employment and a misguided war on drugs. Similar effects can be seen in the higher levels of drug deaths in the North of England and in Wales, also outside of the more affluent South-East which was protected from the worst of those policies. Researchers have shown this to be a predictable and widespread phenomenon:

Drug Overdose Rates Are Highest in Places With the Most Economic and Family Distress

https://scholars.unh.edu/cgi/viewcontent.cgi?article=1339&context=carsey

From the BBC:

During the 1980s and ’90s there was a significant increase in problem drug users in Scotland, which peaked about 20 years ago. There is now an ageing population of drug addicts, mainly men, who have been using heroin for decades. Biologically they are ageing much faster than their real age and they develop multiple morbidity, particularly around respiratory diseases, liver diseases and blood-borne viruses and this adds a further vulnerability with regards to overdose deaths. Last year, more than two-thirds of drug-related deaths were aged between 35 and 54.

Deaths among younger users had been falling since the SNP came to power but rising again as Tory austerity cuts bite.

https://www.bbc.co.uk/news/uk-scotland-48853004