This was one brilliant episode.
Okay, so Jack is under orders from Gaines throughout this episode. Gaines, meanwhile, is using his daughter Kim and wife Teri for leverage. That means one wrong move by Jack, and he could be standing over their lifeless body. Jack is forced to follow Gaines' directions even though they are the exact opposite of what he wants to do - like, switching the real keycard with a fake one and killing Nina... Yes, that's not a typo.
Some of the stuff between Teri and "Alan York" (we have come to know he is a fake) was nice and suspenseful. Teri finds out about his real identity; that he is one of the henchmen working for Gaines and comes up with a plan of her own (something we don't see about Teri in the rest of the episodes). She is almost successful until some agents claiming to be from CTU arrive and kidnap her. Perhaps these guys are under orders from the mole inside CTU? Maybe not. It just shows that the extent of problems currently present is much larger than what we're seeing.
The other two (not so important) plots going on are Rick/Kim and the Palmer/Keith storyline. Rick sympathizes with Kim and lets her escape. Although when Kim witnesses her mother being brought in she refuses to go. I've yet to properly make sense of the Palmer storyline - there are still various directions to which it can go. Either way, the writing is the best aspect of this episode by far. The entire episode was full of plot twists. A very enjoyable hour of 24 for sure.