We're currently debating the Babylon 5 episode Face of the Enemy over at
b5_revisited, which together with the recent Cordelia meta I linked made think about a trope several shows do, with varying degrees of success: one of the regulars goes dark side, via demonic possession, or brainwashing, or via being replaced by a literal doppelganger, depending on the degree of fantasy the show in question employs. In most cases, this only lasts an episode or two, but in some, it's kept up for longer and makes for an arc.
Now, apart from giving the regular actors the chance to stretch their acting muscles, this can, but not always is, used as a reason to shake up the dynamic of an ensemble and change it. If this doesn't happen, i.e. if after the arc is finished, everything falls back on status quo because it wasn't really character X who did dark sidish acts a, b and c, and thus the rest of the ensemble can't hold him/her responsible, I, personally, tend to feel dissatisfied. (Though actually, in regards to the way B5 uses this trope, I have other problems with this storyline, not so much this particular one.) It doesn't seem to be emotionally realistic to me. Going back to one of my earliest internet fandoms, in retrospect I have a lot of respect for the way Highlander handled the Dark Quickening fallout, because there were actually long term consequences to what was only a two-parter, notably for Richie Ryan, who the next time we saw him was anything but fine and dandy, but also for Duncan himself; a crucial character episode like the later Forgive us Our Trespasses, two seasons separated from the Dark Quickening episodes, directly referred to them.
In most cases, but not always, the audience is immediately alerted to what happened, though the other character are not. The big game changing season 2 of Buffy the Vampire Slayer episode, Innocence, draws part of its tension and emotional power from the audience knowing Angel has lost his soul several scenes before Buffy does. (While for the rest of the season, Buffy and the audience are on the same level re: identity status, until the season finale.) One objection I've seen more recently to season 4 of Angel is that this did not happen there, that the audience wasn't told Cordelia was literally not herself anymore until half of the season was over, and that this should have been revealed from the get go, a la Angel/Angelus. Personally, I don't agree with this, and not just because I find the writing for Cordelia more problematic in s3, when she is supposed to be herself entirely. There are several clues along the way, not just Cordelia's dream of watching The Body Snatcher in Apocalypse Nowish, but before that, for example in Lorne's attempt to "read" her while she sings, which results in him sensing something terrible in her. The show plays it like an Agatha Christie mystery, i.e. while aiming for a big shock revelation moment, it does give hints. Also, what happens to Cordelia is a gradual takeover rather than an immediate change of identity. However, the aftermath of said storyline is dissatisfying to me for the above named reason: in Cordelia's s5 farewell episode, there is no sign of what must have been a horrifying experience for her, and none of the other characters has even momentary difficulties differentiating between Cordelia and Cordelia-plus-Jasmine, either.
There are some parallels here to the season 4 Garibaldi storyline; Garibaldi is not suddenly another person. Rather, his mind is altered in ways that push already existing character traits to the fore and thus change him gradually. (Basically, both Garibaldi and Cordelia are Manchurian Candidates, to make a geeky comparison, not Jekyll/Hyde.) The clues here are far more obvious than in s4 of AtS, mind; we see Garibaldi conditioned by someone before he ever comes back to the station, and the identity of the person responsible is increasingly obvious several episodes before Garibaldi and the audience find out for good, though the reason for the alteration isn't stated until then. As with Cordelia, the rest of the regulars, once Garibaldi's innocence is proven, don't show signs of holding what happened against him, which is why I have problems. (Unlike Cordelia, though, Garibaldi himself is shown to suffer from the aftermath, and in fact deals with it for the rest of the show.)
It occured to me, though, that in addition to the "the audience is told immediately exactly what happened and why to regular X" circumstance, there might be another reason why both the Cordelia and the Garibaldi storylines were unpopular in their respective fandoms, unlike, say, the original Angel/Angelus arc in BTVS, or the Buffy/Faith bodyswitch in s4, or the Dark Quickening in Highlander, or the Xena/Callisto bodyswitch in Xena. Gradual takeover means that the regular in question doesn't change immediately. The audience, for a while at least, relates to character X, just as the other regulars do, as the same person they developed attachment towards. They can't immediately reassure themselves "well, this isn't really X", sit back and watch the other characteres react while they themselves know better. Which also means they do blame X for their actions. Now, I find this actually more interesting than the cozy certainty "ah, I'm not really watching X!"; being on the level with the other characters, having to wonder about X. What I have problems is when the emotional aftermath is prettified, see above. (The other problem I have with Garibaldi's s4 storyline is a meta one, to wit, because it's increasingly clear he's not himself, his criticism of Sheridan is never presented as valid, and there is no other character who criticisizes Sheridan in the last two seasons without being simultanously presented as a tool or just plain wrong. So giving the only criticism another regular makes to the character who is not compos mentis annoys me.)
Thinking about whether there was a gradual takeover (instead of an instant possession/body switch/identity change of other fashion) storyline, where the audience and the characters find out exactly what's been going on at roughly the same time, and where the emotional aftermath for the characters satisfies me, I remembered Emma Frost in Joss Whedon's run of Astonishing X-Men. Again, there are clues. (For example, Emma is talking to a character whom the long term comic-reading audience would know to have died in Genosha, a student of hers; since what's going on with Emma is crucially tied to her survivor guilt, that's a pretty big clue.) But exactly what happened doesn't get spelled out until the climax and end of the "Torn" arc, the last but one arc of Whedon's run. And there is one reason why I think Emma's storyline works better already; we get to see the aftermath, not just in one episode/issue, but during the last arc, plus all the other characters react, as does Emma herself. Nobody pretends that the knowledge Emma's behaviour was partially triggered by Cassandra Nova makes everything fine and dandy. Admittedly it's more than that; the reason why Cassandra Nova could get a hold in Emma are Emma's own issues and past, and thus the gradual takeover arc is used for character exploration (Emma's and everyone else's), whereas the characters explored in s4 of Angel are basically everyone but Cordelia herself. (Garibaldi is a case in between. S5 does more in terms of what the aftermath of his s4 storyline means to his own character.)
Thinking of comics, I also remembered the speculation two or so years ago at the start of the Secret Invasion storyline that it would turn out Tony Stark was a Skrull, thus negating/absolving (depending on your position) his entire storyline during the preceding Civil War arc. I thought at the time that would be a disaster, and was very relieved Marvel didn't go this way - not with Tony Stark, at any rate. However, several other characters were declared to be Skrulls, which meant indeed a convenient way to retcon a lot of acts out of existence. In some cases, this didn't come across as a cheap cop-out: Jessica Drew, aka Spider-Woman, had and still has to deal with the theft of her identity. In other cases - well, let's just say I wasn't happy with Civil War era Hank Pym being Skrull-ified. Either way, though, declaring a character to have been replaced by a doppelganger is the opposite of the gradual takeover storyline, to me at least, emotionally speaking. It's saying "that person never had anything to do with the one you loved, at no point". Because here's the most disquieting, and if played right, effective thing about gradual takeovers: it leaves a question mark. Yes, most of the actions would not have happened had not plot interference Alpha triggered the gradual takeover of character x. But not all of them. Who are we, really, if we can't sit back and say "well, that was someone else" but "that was also me"?
It's not always handled well by storytellers. But when it is, see Emma, then it's really great.