It's a common plot device in sci-fi and fantasy television shows for at least one episode to feature the crew getting hit by some strange virus/magical object that causes them to undergo a major temporary personality change. This will generally involve a considerable amount of overacting and general ham, as at least one cast member ending up in their undies. Watching this I was very much reminded of "And the Apple of Discord" from The Librarians (where Lindy Booth got her dress off), an episode of Stargate SG-1 that I can't remember the title of (where Amanda Tapping got her shirt off) and on a similar tangent, "Nightmare in Silver" from Doctor Who (where Matt Smith... kept his shirt on).
Indeed, every show in the Trek franchise has at least one like this and this is the drunken Irish daddy of them all. I'll get to O'Reilly later.
Scotty and another member of the crew beam down to a dying planet (dressed in the most ridiculous red hazmat suits I've ever seen) where the science crew present have frozen to death - the opening shot of this episode is rather arresting. The other member of the crew (who I think was O'Reilly, but I don't recall) breaks the cardinal rule of dealing with a strange death situation - don't take your gloves off!
As a result, nearly the entire crew end up basically getting three sheets to the wind. George Takei gets his shirt off, Spock gets emotional, the nurse with the silver hair (was that in fashion back in the 1960s?) gets romantic... and we get to see the first chase of Shatner well and truly chomping the scenery. Oh and Scotty says that he can't change the laws of physics.
Oh yes, O'Reilly. The resident Irish officer (Ensign? Lieutenant? not sure) does nothing for the popular perception of Irish people when he does the sci-fi equivalent of drinking an entire cask of Guiness - I tried it once, didn't like it - and ends almost destroying the ship in the process.
I doubt that's something he'd want on his permanent record.
Conclusion
Not overly struck by this one; it may be an early example of the type of plot, I have seen it done much better elsewhere.
6/10