Nearly ever crime show has an episode with twins, even NCIS. So...there are twins and one twin kills the other twin or commits a crime using the other twin's name and the investigators have to pull a Spock and figure out the double Kirk problem.
My reaction has always been, "So what?" especially since the twins are almost always played by the same actress or actor.
One twin substitution I like comes from Diagnosis Murder. One twin, a janitor and amateur magician, kills the other twin, a rich jerk. The wife of the rich jerk figures out the substitution and is completely okay with the switch. She does everything she can to protect her murderous brother-in-law until a minor mistake (naturally) brings the entire new relationship tumbling down.
It's skillfully done and plays on another romance trope: the wife discovers that the man pretending to be her husband is preferable to the actual husband.In addition, the twin in Diagnosis Murder is played by Nick Chinlund, who has a resume as a misunderstood bad guy. He shows up early on in CSI and later in Castle as a charismatic criminal. He may be a bad guy but he never totally descends into pure evil.
I argue elsewhere that casting directors are aware of these previous casting decisions. Actors gain reputations for delivering particular auras, likability or unlikability. Nick Chinlund was perfectly cast as the "bad" brother who is yet more appealing than his "good" twin.
And more importantly, from a writing perspective, the twin switch in the Diagnosis Murder episode actually has a thematic purpose and plays out alongside the dual threads of romance and magic. It isn't just a way for a director to get clever with special effects.