Seeing as how this is a production/behind-the-scenes question, I'll ask it here instead of the Sci-Fi SE.
Episode S05E19 of Stargate: Atlantis, titled "Vegas", is drastically different from the show's usual formula. The entirety of the episode takes place on an alternate reality version of Earth (mostly in Las Vegas hence the title), where John Sheppard is a detective on the trail of a serial killer who is
really a Wraith that crash-landed on Earth and is feeding on the victims.
This seems like a really odd choice considering that it is the next-to-last episode of the series. In addition, the ending "twist" seems like a rather obvious Diabolus ex Machina (warning: TV Tropes link) for getting the Wraith to Earth - something that has been teased since the first season.
Has anyone involved with the production of "Stargate: Atlantis" explained the reason for such a drastic departure from the series formula in this episode?