Season 2, Episode 24 (March 2, 1974). Written and directed by Larry Gelbart.
The Season 2 finale introduces what would become one of the show's most enduring recurring characters: Colonel Flagg (Edward Winter), the paranoid Army intelligence agent. When a pair of intelligence officers from different agencies descend on the 4077th to investigate perceived security risks, Hawkeye and Trapper decide to have some fun at their expense [1][2].
The episode—written and directed by Larry Gelbart himself, who was clearly delighted by the character—is essentially a showcase for Flagg. Winter plays him at full pitch from the start: alternating between agencies (CIA, CIC, CID), using a string of aliases, and treating every conversation as an interrogation. Hawkeye and Trapper's attempts to "have some fun" with the new arrivals devolve into a battle of wits in which the 4077th's regulars turn Flagg's own paranoia against him [1].
This is technically the first on-screen appearance of the character as "Colonel Flagg." A few episodes earlier, in "Deal Me Out" (Season 2, Episode 13, December 8, 1973), Winter had played a similar character named Captain Halloran—a friendlier, poker-playing version of the same archetype. Most fans and Wikipedia treat Halloran as Flagg in disguise, supported by a later Flagg line to psychiatrist Sidney Freedman in "Quo Vadis, Captain Chandler?" (Freedman also appears in "Deal Me Out") [1][2].
Edward Winter would go on to play Flagg in five more episodes across the rest of the series run, making him one of the show's most reliable recurring guest stars.
[1] M*A*S*H Season 2 - Wikipedia [2] List of M*A*S*H characters - Wikipedia