Like I said, it can be argued that Gary Mitchell died the moment that the entity from the barrier took control of his body. From that point on, it wasn't Gary. So in a very real sense, he WAS killed in the line of duty. And from that POV, Kirk's log entry is accurate.
As far as I remember, it was never stated that some conscious alien entity took control of Gary's body and displaced his own consciousness. The energies of the barrier altered his own person.
Kor