The Doctor is actually Rex Willis, Ana/Baroness' brother, who was presumed dead in an air strike four years prior to the setting of the film, which led to Ana's separation from then boyfriend Duke. Rex was in a bunker seeing the first information of nanobite technology (from a scientist played by Kevin J. O'Connor). Rex had secretly injected nanobites into Ana's body so that he could control her to help him create Cobra, and use the financial help of James McCullen.
Ripcord is able to stop the two missiles from destroying Moscow and Washington, D.C. The nanobites from the missile destroy his plane, but he survives.
Snake Eyes and Storm Shadow have their epic battle, and Snake Eyes kills him as a final revenge for Storm Shadow killing their sensei 20 years ago when he clearly showed preference to Snake Eyes.
The Doctor and a badly burned McCullen manage to escape the underwater base, but not before Duke incapacitates their submarine. The Doctor injects McCullen with nanobites designed to turn him into Destro, and tells of the rise of Cobra, after which he dawns the Commander mask (updated for the new millenium and screen). He and Destro are captured and incarcerated. Ana is freed from her brother's control, but the doctors cannot find a way to remove the nanobites from her body, but she remembers her love for Duke, who promises to do everything he can to have her released from prison early. GI Joe General Hawk asks Duke and Ripcord to join. They accept. THE END...well, not really.
Even though Commander and Destro have been captured and Baroness is imprisoned, Zartan was injected with nanobites to make him look like the US President, who he supposedly kills unknowingly to the government, and takes his seat in the White House as the screen cuts to black.