Ambiguous aspects of any art may be interpreted by the audience. Only the creator of a work can "defend" a particular interpretation or intent. (So unless the writer or director of this episode is a member of the forum...)
STAR TREK was generally very forward-looking; I would say the episode was probably a commentary on contemporary society (rather than the future world of the Federation)—that capable individuals were excluded from rising to their fullest because of tradition or bigotry.
Today's audiences might also see an argument against "affirmative action"—the granting of responsibilities unwarranted by an individual's skills and temperament. Janice Lester still failed to cut it as a starship captain even when inhabiting the body of an athletic and vigorous man. So it was her
lack of skill and/or temperament, not those of her body.
As for "if only...", someone is always going to be unsatisfied with their lot in life. Despite a failed relationship, Kirk still respected Lester. She could have chosen another direction, perhaps something to further the lot of other women becoming starship captains, or some other role denied them (perhaps) because of their gender. Instead she "kidnapped" someone else's body and attempted to murder those who got in her way. If only... she had done something more productive. Life is never either-or. As Spock said, there are always alternatives.