Background and Objectives: This study aimed to evaluate the potential chemopreventive effect of antidiabetic medications, specifically metformin and pioglitazone, on lung cancer in patients with type 2 diabetes mellitus (T2DM). Additionally, the potential dose–response relationship for metformin use was analyzed. Methods: We conducted a retrospective cohort study utilizing comprehensive national health insurance and cancer registry databases to gather a large cohort of T2DM patients. Cox proportional hazards regression models were used to assess the risk of lung cancer across different antidiabetic medication groups, adjusting for potential confounders such as age and gender. A dose–response analysis was conducted for metformin users. Results: Our results indicated that metformin users had a significantly lower lung cancer risk than the reference group (HR = 0.69, 95% CI [0.55–0.86], p = 0.001). The risk reduction increased with higher cumulative metformin doses: a metformin cumulative dose between 1,370,000 and 2,976,000 had an HR of 0.61 (95% CI [0.49–0.75], p < 0.001) vs. cumulative metformin dose >2,976,000 which had an HR of 0.35 (95% CI [0.21–0.59], p < 0.001). No significant association between pioglitazone use and the risk of lung cancer was found (HR = 1.00, 95% CI [0.25–4.02]). Conclusions: This study shows that metformin may have a dose-dependent chemopreventive effect against lung cancer in T2DM, while the impact of pioglitazone remains unclear and requires further investigation.