Window of Opportunity

Window of Opportunity is the sixth episode of the fourth season of Stargate SG-1.

Plot
SG-1 is currently assigned to P4X-639, a planet currently experiencing a coronal mass emission from its sun, causing a geomagnetic disturbance that Carter is measuring. Daniel, meanwhile, is currently examining the writing on a device in line with the Stargate with an alien archaeologist named Malakai. Daniel observes that the writing on the device is similar to Latin. While he is thinking aloud about the nature of the machine itself, Malakai urges Daniel and his teammates to leave due to the incipient emission.

A sensor device that Malakai is holding suddenly alerts him that the geomagnetic disturbance has reached its peak and that he has to act immediately. He pulls out a concealed weapon and stuns Daniel before starting the machine. Carter, meanwhile, has finished the preparations for her readings and O'Neill calls for Daniel, who fails to respond. Suddenly the Stargate activates behind them and they duck out of the way of the kawoosh. Meanwhile, on Earth, the Stargate has activated at the same moment, causing a series of electrical arcs around the Stargate. On P4X-639, O'Neill and Teal'c go to Malakai while Carter tends to Daniel, but after a moment a flash strikes the three at the altar and the scene flashes into white.

Suddenly, O'Neill is at breakfast, eating Froot Loops, and is sitting with Daniel and Carter, in the middle of Daniel asking O'Neill his opinion of something. He asks them if they had just been on another planet, to which the others say no, and say they're going to be late for their briefing.

The briefing is about the upcoming mission to P4X-639, which SG-15 had visited two weeks earlier, measuring the solar activity. Teal'c and O'Neill both observe that they've already been through this briefing, to go to the planet and set up a remote observatory, which according to them they had just been doing. The others are skeptical about his foreknowledge of the briefing, except for Daniel who observes that O'Neill never reads the reports ahead of time. At that moment, an unscheduled offworld activation occurs, and Teal'c and O'Neill both give details about what is about to happen: SG-12 is returning ahead of schedule and one of their number has been injured.

O'Neill and Teal'c are both inspected by Dr. Frasier while they relate the details of the mission that has not yet happened. Based on the odd occurrences, General Hammond decides to postpone the mission until they know what's going on. Daniel stops O'Neill in the hallway afterward to ask about details of the ruins, whereupon he is run into by Sgt. Siler, which O'Neill implies he'd known would happen and did not stop. Some time after this, Hammond confirms that O'Neill and Teal'c are in perfect health, but before they can be put on active duty there is an unscheduled off-world activation, accompanied by the same arc lightning effect seen before. A moment later, there is a flash of light and O'Neill is again at breakfast at the same moment Daniel asks his original question.

They once again go into the briefing, with O'Neill unsuccessfully trying to convince them he knows what they will say (which are all obvious statements in context) until the return of SG-12. They are once again examined by Dr. Frasier, whereupon Hammond walks in, but O'Neill forestalls him before he can postpone the mission this time. O'Neill then again meets Daniel in the hallway, where is once again run into by Sgt. Siler, but this time before that happens Daniel reveals that the writings are a variation of Ancient. Teal'c and O'Neill then visit Hammond, this time successfully convincing him to let them return to the planet.

Once they are on the planet, they encounter Malakai, who at first feigns ignorance. While examining Malakai's bag, O'Neill sees an image of the man's wife. Before they can get further, however, the machine activates automatically, and Malakai makes a slip, giving Carter's name before he's been told what it is. O'Neill orders Malakai to shut it off but he refuses, and Daniel has no idea how, even though he can read Ancient. Before they can continue, however, there is a flash of white and O'Neill is once again at breakfast with Daniel and Carter.

When Teal'c and O'Neill get to the briefing, they take the initiative of explaining that they're in a time loop and try to get out of being examined by Dr. Frasier this time (unsuccessfully). O'Neill and Teal'c then meet Daniel in his office, presumably at the time of the accident in the hallway in previous loops, and they stress him translating the writing on the altar, but he points out that that wouldn't allow them to operate the machine. In a briefing with Carter immediately after, she hypothesizes that since the arc lightning energizing the gate was transferred to Earth via the Stargate, they should attempt to dial out before Malakai can dial in. They attempt to do so but cannot dial out, and while they are attempting to find the problem, the incoming wormhole activates and the loop begins again.

O'Neill and Teal'c experience loop after loop. They are seen in Daniel's office attempting to get him to translate the writing on the altar, but he explains that he can't translate it in less than a day. O'Neill attempts to play a recording he made of the same conversation in the last loop, but the recording ceased to exist when the loop began again. Daniel points out that the only way they can help is by learning latin and remembering from one loop to another.

Carter, meanwhile, has discovered that the Ancient device on P4X-639 simultaneously activates 14 Stargates, including Earth and Alaris, the planet SG-12 had been stationed on, cutting them all off from the normal flow of time in the rest of the universe.

O'Neill and Teal'c begin learning Latin so that they can begin learning Ancient, and O'Neill mentions to Teal'c that Daniel always asks a question but he hadn't been listening the first time. Teal'c points out that he also has to "endure some discomfort." The loop begins again, whereupon it is shown that at the moment of the loop's start, Teal'c is hit in the face by an airman opening a door. In one loop Teal'c finally vents his frustration by slamming the door back on the airman.

There is a montage of scenes from various loops: O'Neill and Teal'c have become quite prficiant in the language at a certain point since they correct Daniel's translation, then O'Neill takes up juggling, then Teal'c does and again becoming proficiant at it. Jack finally "takes a loop off" and tells Teal'c that if they don't get out of it soon, he'll go crazy, or 'wacko' as he puts it. In a loop after this, while O'Neill and Teal'c are in charge of the translation while Daniel seems to be learning from them, Daniel makes an offhand remark that the two of them could do anything they wanted with no consequences since they know the loop would reset at the end anyway. Getting an idea, they both suddenly leave.

For several loops, the two indulge in whatever behavior they feel like. O'Neill tries pottery, bicycles through the base, golfs with Teal'c to Alaris through the gate (and shouting at Gen. Hammond for interrupting his back swing), and resigns his commission from the Air Force so that he can kiss Carter.

Finally, Daniel has finished the translation and confirmed that the planet was once an Ancient outpost but wiped out by some unidentified disaster at some point in the past. In order to avoid this, the Ancients on the planet built a time machine to go back and change their fate, but the machine never worked properly, only creating a loop repeating over and over. Faced with this, the Ancients shut down the machine and let the end come.

SG-1 returns to the planet to break the loop, but Malakai is expecting them and has the altar blocked by a Goa'uld force shield. In attempting to talk Malakai into shutting down the machine, he reveals that the reason why he's doing it is to see his wife again, who died twelve years earlier. However, since she died of a congenital heart condition there is no way to save her. O'Neill tells him that he wouldn't be able to stand going through her death again, telling him of the death of his son and that he could never go through that again. Malakai agrees and shuts down the device before it begins again.

Back on the base, O'Neill, Carter, and Daniel are at breakfast. O'Neill comments on how the oatmeal is a nice change of pace from the Fruit Loops he has been eating. Carter informs them that the Tok'ra had been trying to reach them for over three months but the loop could have lasted for longer, there is no clear indication how long exactly it had lasted. Daniel asks O'Neill if he ever did anything "crazy" without fear of consequences while trapped in the loops. O'Neill states that he asked that before, but instead of elaborating he gives a long look at Carter and continues eating.

Notable Quotes
O'Neill: I'm telling you Teal'c, If we don't get out of this soon I'm going to lose it... Lose it, means go crazy, nuts, insane, bonzo, no longer in control of ones faculties, three fries short of a Happy Meal... WACKO!"

While hitting golf balls through the activated stargate...

O'Neill: So how far away is Alaris anyway? Teal'c: Several billion miles, O'Neill. O'Neill: Ooh, that's gotta be a record.

Hammond: Colonel O'Neill, what the hell are you doing?! O'Neill: In the middle of my back swing??!!

Notable Scene
''O'Neill and Teal'c trade off at the blackboard. O'Neill sits down next to Jackson, stretches and utters something like "ewch gawkh" in frustration after multiple rounds of working on the translation, during which the passage of time was indicated by both O'Neill and Teal'c learning to juggle.'' Jackson: Exactly how many of these loops have you, have we been through? O'Neill: I've lost track. Why? Jackson: That must be frustrating. O'Neill: Ah, yeah. Jackson: On the other hand, it's kind of an opportunity. O'Neill: How's that? Jackson: Well think about it... if you know in advance that everything is always going to go back to the way it was, then you could do anything, for as long as you want without having to worry about consequences. Teal'c turns from the blackboard where he's been working to look at them. O'Neill: Excuse me. O'Neill leaves the room followed by Teal'c. What follows is one of the most amusing montages of scenes in Stargate history as O'Neill and Teal'c explore this new found "freedom".