[Note: The song doesn't appear in the episode in its entirety, including all stanzas and the instrumental section (which underscores a montage of majorettes trying out for the squad). I pieced this together from as many stanzas as I could, and threw in the instrumental section as a "bridge".]
The music credits on the episode didn't indicate otherwise, but of course, that may not be a true indicator. The instrumental version sure sounds like he arranged it, though, so even if the song wasn't written by him, his touches are there IMO.
Here's a picture of Dean Reed and his pals singing the song:
If he wrote a new theme, why was it relegated to the end credits?
Williams' theme was used for both the opening and closing credits during the third season.
Ah, ok. Then I haven't been able to find a third season episode on youtube. The ones that are available there all start with the old theme (written by???), but has the Williams theme over the end credits.
As run on the Retro TV channel, the opening credits are mixed and matched, and appear to have no true bearing on what season the episode is from. The YouTube vids could have originated from these airings.