A myocardial infarction is a heart attack if I'm not mistaken. Here is a CDC instruction on how to complete a cause of death form:
https://www.cdc.gov/nchs/data/dvs/red_form.pdf
Part I (Chain of events leading directly to death)
• If the condition on Line a resulted from an underlying condition, put the underlying condition on Line b, and so on, until the full sequence is reported. ALWAYS enter the underlying cause of death on the lowest used line in Part I.
Part II (Other significant conditions)
• Enter all diseases or conditions contributing to death that were not reported in the chain of events in Part I and that did not result in the underlying cause of death. See examples.
• If two or more possible sequences resulted in death, or if two conditions seem to have added together, report in Part I the one that, in your opinion, most directly caused death. Report in Part II the other conditions or diseases.
What's even better is one of the examples specifically shows how to annotate a gunshot wound. The gunshot is not listed as the immediate cause of death. The immediate cause of death is listed as a Cardiac tamponade. A gunshot wound is listed as the underlying cause.
All this is to say that you may be mistaken about what the death certificates say, or they may have annotated them differently 30-40 years ago. Either way, today they specifically list any and all underlying conditions which contributed to the death, which would most definitely include drugs. Those are counted as drug deaths.
Bottom line, today and when these statistics are compiled from, no matter what ultimately killed the person, whether a myocardial infarction, that drugs contributed will absolutely be annotated on the death certificate and their death will be listed as a death due to drugs in the official statistics.