Wow, they really figured TV was a disposable medium back then, didn't they? I've heard of shows remaking scripts from other shows, and there's a Bionic Woman episode that's a remake of a Six Million Dollar Man episode -- but the same show doing the same script twice, five years apart? I've never seen that before.
It happened on MISSION: IMPOSSIBLE too - while the show was still on CBS. They also recycled some scripts for the later ABC incarnation of the series - that was also due to a writers strike.