***This entry contains spoilers. Don't read if you don't want 'em.***
A staple of the science fiction genre is the "What if?" plot. In a "What if?" plot, the writers are free to go outside the continuity of the series, sometimes drastically changing things. The difference between this plot, and the main continuity, is that for the plot, the writers ask "What if X happened?", where X is something completely off the wall, like a major character becoming a vampire in a setting where vampires don't exist, or something like that.
Now, "What if?" plots can generally be broken down into four types: Weirdness, Time Travel, Alternate Reality, and Dream/Hallucination.
Weirdness - This would be something that, while out of the ordinary in the continuity, is within the scope of the universe. Prime examples would be in the Star Trek episode "A Piece of the Action", where the Enterprise encounters a world that is literally out of a gangster novel. Weird, but it still fits in the continuity.
Time Travel - Time travel stories typically involve going backwards or forwards in time, and both have their fair share of perils. Go back, and you risk changing the past, and negating your own existence. Go forward, and what you learn there could change the future. This is the second most common form of "What If?" scenario.
Alternate Reality - In a universe where parallel realities exist, sometimes the writers will step into those alternate realities, and see what might have been. A good example of this would be in the X-men comics, where they routinely explore parallel worlds, with the best example being the "What If?" series. This is by far the most common type of scenario when dealing with a "What If?" plot.
Dream/Hallucination - Rarest of all is the dream/hallucination scenario. In part, writers are not fond of using this option because, if it is done wrong, it can seriously anger fans. In this setup, suddenly, inexplicably, things are completely different than they used to be. However, when you get to the end of the plot, you realize it was all a dream, or perhaps a vision or hallucination caused by some outside force. Regardless, none of it is real, and usually it serves to teach the main character of the plot some lesson.
How can you tell what kind of "What If?" plot you're in? Well, there's a few signs to look for.
If they have a simple means of getting into and out of the situation, then you're looking at normal weirdness. If they just have to beam up to the ship, or jump through the stargate, or something like that, then you're in normal weirdness territory. The situation falls within the "norm" of the series, even though you have soldiers with MP-5s dealing with natives armed with crossbows fighting enemies with rayguns. Its par for the course, in other words. Note that if the series centers around going back and forth in time, or dimension hopping, then any time travel or alternate realities count as normal weirdness.
But what if that isn't the case? Then you're looking for one of the other situations.
Time travel is usually the easiest of the three remaining scenarios to discover. Typically, you'll see some means of travel that takes you elsewhere in time. Either its a time machine, or your means of faster than light travel slingshotted you around a star, or something of that nature. Regardless, time travel usually means that you either go back in time, or forward, and they are very obvious with the method. There are exceptions, like Planet of the Apes, but for the most part, people are up front with time travel.
Alternate realities can be tricky. Depending on how 'close' the realities are, you might not know you're in a different world until later. However, like time travel, there's almost always some clear means of travel between the realities. A wormhole, or a transporter accident, or something like that is always present. Maybe everything went purple for a moment. Regardless, there's always a clue that something has changed.
The Dream/Hallucination method is by far the most subtle of the "What If?" plots. Many times, something will happen, and things will seem to progress on, but in reality, that' where the dream begins, like when Dorothy hit her head in the beginning of the Wizard of Oz. But there are times when it sneaks up on you.
Take the recent episode of Sanctuary. The episode starts off with Magnus waking up in a post-apocalyptic world, with no memory. We know that this is not in the Weirdness category, so we can eliminate that altogether. After Will tells Magnus that she's been dead for three years, time travel appears to be the most likely option. However, the clues point elsewhere.
First, in Dream/Hallucination episodes, there's always something the main character is trying to remember, something they keep coming back to, even though it seems to have no real bearing on the matter at hand. A trip to Honduras, for instance.
Second, look for something out of the ordinary. Again and again through the episode, you see a white, misty shape moving through the background around Magnus. This is a clue that things are not what they appear.
Third, the 'friend' who keeps trying to distract the main character from their work. In this case, Will trying to get Magnus to leave, and give up. This usually is a sign that this is simply a mental battle between different parts of the main character's subconscious.
Finally, things conveniently happen for no real reason. Magnus happens to escape will, and happens to find another survivor in a city full of zombies? If it seems too convenient to be true, its usually false.
By the second commercial break I had called it as being a dream. This is confirmed by the fact that as Magnus pieces together her memory, combined with the information from a conveniently recoverable computer log, she makes the connection that it is her fault everything happened. And then the illusion fades away, the spirit of the tomb having conveyed their warning to stop Magnus from opening the vial of doom-stuff.
If you can read the signs, it is plain that the whole thing was a dream.