I didn't recall all the convoluted details, but GR did seem to be the final writer.
"Inside Star Trek" has a complete break-down of script dates, so I take it as being fairly reliable:
(pg 286, 287)
March 16, 1966 ... Story assigned based on H.E.'s pitch.
March 21, 1966 ... First story outline (HE)
May 1, 1966 ... 2nd version (HE)
May 13, 1966 ... Final outline version by HE, and he is given the go-ahead to write a script.
June 7, 1966 ... First draft teleplay dated "June 3, 1966" is recieved from HE.
August 15, 1966 ... Revised final draft teleplay dated "August 12, 1966" is recieved from HE.
Steve Carabatso's rewrite (deemed to still be unfilmable) angers HE, and he offers to rewrite it again sans pay.
Dec 19, 1966 ... Second final draft recieved from HE, dated "Dec 1, 1966".
January 9, 1967 ... Date on the Gene Coon rewrite.
January 23, 1967 ... Date on the DC Fontana rewrite.
Febuary 1, 1967 ... Date on the GR final revision (shooting script).
Febuary 3, 1967 ... Shooting begins.
Febuary 14, 1967 ... Shooting ends.
March 27, 1967 ... Finished Episode delivered to NBC
April 6, 1967 ... Telecast.
The episode required 11 months to write, 8 days to film, 6 weeks of post, and cost
$250,397.
The Episode was budgeted at
$190,635 - an abnormally high amount to begin with.
Woo, that story never gets old!

But hey, the episode ended up great. The only way it could've been greater is if someone died making it. At the rate they were going it had better have been the greatest episode EVER, or heads were gonna roll.