All you need to fix this episode is to include a line of dialogue that clearly refutes Lester's delusion.
And remember Lester said, "Your world of starship Captains excludes women." She referred to Kirk rather than Starfleet. She was enraged and embittered because Kirk chose his career rather than be tied to her.
'Fraid not. Pretty much every line that references women in particular is involved in sexism, as I said already, and now I'm just repeating myself, as code either for a glass ceiling or, in the case of the last line of the series, for women accepting their place. That code, the source of the objections, needs to be actually expunged, to fix the episode.