Originally, back in the pilot, the sleeper agent was going to be Takashima, and she would have shot Garibaldi in Chrysalis. I think JMS kept hold of the sleeper agent idea, but I haven't read anywhere that he had specifically moved it to Talia until Divided Loyalties – correct me if I am wrong though.
(Edit – some comments on the Lurker's Guide page do indicate that Takashima's sleeper personality plot was moved to Talia between the pilot and the series, but I don't see anything from JMS outright confirming this. I'm sceptical, otherwise surely Ironheart would have known about it? Talia's character seemed to be heading in a different direction).
Jan made an excellent point in another thread that if Kosh was recording her personality he was going about it in a strange way – recording 'fear', 'terror', 'surprise' – this doesn't seem like he was recording a personality. Maybe he was recording her thoughts related to these to use against her, or someone else, in the future as a weapon. This is implied at the end of Divided Loyalties – Sheridan says that they need to find someway to protect themselves from what Talia could do to them, and then Garibaldi remembers Kosh.
I'm going from memories of discussions years ago but I do remember the idea that each character had a "trap door" being raised with this example specifically rather than having the trap door there to be potentially used my multiple characters.
Whilst Kosh's recording wasn't clearly of her personality I think you could take that as JMS not wanting to be too obvious, maybe also because he wanted to give himself some leeway with future alterations as well along the lines of what actually happened. Really though I never saw that as a good fit and wasn't supprized that it was never mentioned again. The threat from sleeper Talia wasn't that she would come back to B5 and need to be chased off, it was from what she knew and would take back to the Corps.
You could also argue that it would not need to be her entire personality as Passing though Gethsemane showed that the similar "mind wipe" wasn't nearly as final as was suggested and maybe recordings of Talia's emotions could have been used in a similar fashion to bring back her original personality.
I love love love this idea. It fits more with how TV is written these days, than back in the days of B5 when, even though it was telling a story arc, was still episodic in how it went about that. You could imagine that were it being made, this plot line could take up the second half of the season, building up the tension – we know that one of our beloved characters is not who we think they are, but who? Make more of making us think it's Ivanova, build in more red herrings, show the characters all becoming more and more suspicious as they deal with not knowing who to trust, and agonising over whether they or their colleagues are dead people walking, as soon as that telepathic signal is sent, and then the denouement in dramatic fashion..
I would agree there B5 didn't leave specific points of drama hanging across multiple episodes to the degree a lot of modern TV does, indeed I think that difference could make a potentially rebooted series more interesting
My point was more that I think that this episode could have been spilt into two parts each of which would still have been quite self contained. The first part could have had the Ivanova/Talia hook up and a more extended plot around Lyta's return with a cliffhanger about the sleeper/mole at the end that could have been delt with in a the second episode.
Lyta's return was rather brief being delt with via a hefty chunk of exposition that could have been broken up over the episode plus obviously the potential for a good deal of action. Have some of the main cast travel to Mars of elsewhere looking for her(maybe even have her down below on B5 itself) after being told by someone in the know that she had vital info and tangle with the Corps and Clarks associates then obviously have her react negatively to them in a surprising manner at the end thinking they maybe the sleeper.
Likewise I think if JMS had been allowed to make it more obvious the Ivanova/Talia relationship could definitely have benefited from more time. Theres a tendency these days to view gay storylines in this kind of context as mere fan service/titillation but I think here JMS actually had an interesting matchup for potential for good drama and some chemisty. The characters obviously have a connection though the Corp who Talia would be further rejecting and both were obviously emotionally quite guarded with as you say the whole thing being partly a setup for what happens latter with Ivanova/Marcus.
If you have the whole of the second episode to deal with the sleeper I think that would provide a lot more room for raising the drama/tension the way I suggested. If you flesh out the Ivanova/Talia relationship as well then that gets even more of a punch, as it was I felt the sleeper Talia gloating to Ivanova was already very effective.
Again my guess is that JMS's problem was that AT leaving cropped up partway though Season two and left him having to deal with it rather more quickly than would have been ideal. The tail end of the second season really is packed with great episodes(still probably my favourite run of the series) and I think emotionally provides a lot of the backbone for the show as a whole, not sure you can lose any of them. The chinks of light you start to see from the end of the Long Twilight Struggle into the next two episodes and especially Sebastian's message really depend a lot on things falling to bits and the self sacrifice within in the episodes prior.
Delenn knows what she's letting herself in for when she follows the Markab into isolation in Confessions and Lamentations and Ivanova knows what she's likely in for trying to say goodbye to Talia searching for any sign of the previous personality. No smart comeback or threat given in response just taking the emotional punch to the gut because its the right thing to do. In these kinds of programs the threat of death is so ever present that I think that kind of emotional sacrifice if anything often makes more of an impact.