Opioid use disorder (OUD) is a chronic disease requiring long-term treatment and is associated with opioid overdose and increased risk of mortality. However, existing randomized clinical trials focused on short-term treatment engagement and detoxification rather than overdose or mortality risk due to limited follow-up time and ethical considerations. We used a hypothetical trial framework to conduct a retrospective cohort study to assess the effectiveness of time-varying buprenorphine-naloxone on opioid overdose and death. We identified 58,835 insured adult patients with OUD diagnosis in the US, 2010-2017. We fit a marginal structural model using inverse probability weighting methods to account for measured baseline and time-varying confounders, as well as selection bias due to possibly differential loss-to-follow-up. We found that receipt of buprenorphine-naloxone was associated with reduced risk of opioid overdose (hazard ratio (HR) = 0.66, 95% confidence interval (CI): 0.49, 0.91), death (HR = 0.24, 95% CI: 0.08, 0.75), and overdose or death (HR = 0.58, 95% CI: 0.40, 0.84). The E-value for death was 7.8, which was larger than the upper 95% CI of the association between each measured baseline variable and all-cause death, which implies that the unmeasured confounding itself may not explain away the estimated effect of treatment on the endpoint of all-cause mortality.