Of these I think the funniest would be "By Any Other Name". In my view Scotty drinking with the Kelvan is one of the funniest scenes EVER in trek. I know many people hold "A Piece of the Action" up as one of the best, but after repeated viewings there are some parts other people enjoy that I find annoying. Not that the episode is bad, it was fun, I just don't hold it as highly as some others. Same as "The Trouble with Tribbles". In my mind the best thing about the episode was Worf being able to say in DS9 that the Tribble Homeworld had been obliterated. That was funny.