Indeed, that scene with Yeoman Julie Cobb (I forget her name) and the security guard portrayed by a black performer. Given that it is an American show and how race works in America....one might think that 'Oh, good grief....the black guy is going to get!"
However, we get a little surprise. Kirk is upset that the cute yeoman has been 'sacrificed' and the security guard is the one who lives.
For me, I've always disliked the idea (perpetuated mostly by fans) that Star Trek is progressive. Especially, since 'progress' means different things to different people depending on one's experiences,including race, gender, sexual orientation....etc. Albeit, 'progress' is usually measured and viewed within racial lines.
If Star Trek is 'progressive' it usually is when it's subtle, not in your face, such as: 'LOOK FOLKS, WE HAVE ONE BLACK PERSON IN A SEA OF WHITE PERFORMERS! WE ARE A PROGRESSIVE SHOW!" Or, "LOOK FOLKS! WE HAVE A BLACK CAPTAIN ON A SHIP THAT IS GOING TO BE DESTROYED! PROGRESS! YES, HE'S" - and it's usually a 'he' - "IS GOING TO DIE, BUT HE DIES WITH HONOR! PROGRESS!" (Note: This is thinking that has spilled into other spin-offs during the Berman era. Of course, when we have an episode like 'Code of Honor' with a cast of mainly black performers - despite whatever when on behind the scenes - we have fans who are majority 'white' cry "RACISM! RACISM!")
Thankfully, in the age of the internet (as well as people overall becoming more aware of racial disparities and roles, basically put in place by American society) we can have another look at many of these images from past and present film and television and re-evaluate them.
In regards to that scene from 'By Any Other Name,' I want to say that Warren Stevens' alien possibly was making a statement. Maybe, like many aliens in the original, saw Earth as a place that still needed to grow up. For example, the writers would have Archer from "Enterprise" say 'we' - 'we' meaning Earthers - 'have put aside our differences.' (Well, I didn't see that reflected in the crew, nor reflected when the blue Andorian Shran would call humans 'pinkskins' basically ignoring those with dark or 'chocolate' skins. Now, if they put Shran under a pointed hood that probably would have made more sense

).
Interestingly, in the TNG episode 'Where the Silence Has Lease' the sacrifice to an alien 'testing humanity' IS an Enterprise crewmember....and that crewmember IS a black man. (It's almost as if the writers wanted to rectify their mistake in 'By Any Other Name'

).
Too, I posted many months ago how black people actually seem to do pretty well in red, given that 'red' is supposed to be a curse in the Star Trek franchise. We have the guard from 'By Any Other Name'...Uhura...as well as Sisko. The one unamed crewman from 'Where Silence Has Lease' is an anomaly.
Like the guard in 'By Any Other Name' that's a bit of subtle progress, i.e. it wasn't intended, and probably went over the head of the writers and directors.
Anywho, I'll probably add a bit more, but I found that little tidbit from this episode pretty powerful. Especially, when I - a black man working to get into film and television and someday have his own production company - look back at these images, especially given the current events in regards to 'race.'
(Quick Sidenote: I've seen some subtle 'progressive' scenes with Uhura, a black woman, being sexy and tough in 'Mirror, Mirror.' As well as Sulu, an Asian man, being tough and having a sex drive in the same episode).