My standard answer for all the questions about JL is "she's nuts." Pretty sure they never said a woman couldn't be captain. Janice Lester wanted to be Jim Kirk. Seriously, she was so nuts the squirrels tried to carry her off.
The "if only ... " sentence, if completed, would be: "As rich as any woman's, if only she wasn't frickin' nuts."
That's one way to put it! I always thought it was that she was a bit unhinged, and her portrayal in the episode is certainly evidence of that. I never thought Starfleet actively prevented women from becoming captains in any way, as we've seen in the NX-02 Columbia (it is Enterprise, so it's after TOS, but it could count for some people) and the ship from Star Trek 4. I always thought that there were plenty of other ships that we never saw due to budgetary reasons, and that plenty of them had female captains.
Starfleet to me is well past actively putting certain people in charge of a ship to meet an artificial goal to make themselves feel good about themselves, and looks to the merit of someone to put them in charge of the lives of 430 people and put them in positions of responsibility of diplomacy and defense.
Short answer - Janice Lester was a bit crazy, and Kirk was right not to pursue the relationship in hindsight. He probably saw signs that she was unstable back then and broke it off.