Even though the doctor told him smoking was deleterious to his health, he didn't quit until just before he died.
I'd like to know if it means "he died as a result of not giving up smoking".
Sure. Maybe he finally kicked the habit and the next month he was killed crossing the street by a drunk driver. Or trampled at a Who concert. Or shot by a bank robber.
I'm not a teacher, but I write for a living. Please don't ask me about 2nd conditionals, but I'm a safe bet for what reads well in (American) English.
Actually how he was killed and why doen't matter. The important thing is whether he quit or not before his death.