Eh, Data's Day might have more comedic moments than a typical TNG episode, but it still isn't really a comedy, IMO. And I've never viewed anything in A Matter of Time as comedic. At all.
It's possible the original intention was for that to be a comedy, but things didn't turn out as planned. Then again, it's been ver a decade since I last watched that one, so maybe I shouldn't comment.
I think that 95% of The Next Generations back catalogue make me laugh, purely because of their shitness, but hey, thats just me.
For honorable mention, even though it is not a comedy episode in the slightest, I would nominate the teaser from "The Pegasus." The entire Captain Picard Day scene is hilarious, IMHO. Stewart and Frakes sell it brilliantly.
Yeah, it's at times hard to believe that scene is from The Pegasus, given that the rest of the episode is so deadly serious. The same episode which has Riker facing actions from his past which could potentially end his career starts off with Riker playing with a Captain Picard doll.
I think that's part of what makes that episode work so well. It starts off with this ridiculous farce, which totally works against the seriousness of the rest of the episode. It makes the rest seem even darker, by comparrison. As for the rest, I honestly don't think of them as comedies. True, many episodes have more than their share of humor, but there's always SOME serious element to the episode. To me, the term comedy sounds like Spock will be running around with a woopie cushion.
I like message in a bottle (VOY) a lot as a humorous ep. Even though it may disqualify because it is 'an exciting adventure', and, even worse, relevant to the entire VOY arc (as it furthers the entire series 'plot' ).
TOS: A Piece of the Action The Trouble With Tribbles Spock's Brain (they couldn't possibly have been serious) TNG: Q Who? Hollow Pursuits DS9: The Magnificient Ferengi Little Green Men Trials and Tribble-ations VOY: Threshold (again they couldn't possibly be serious) Bride of Chaotica Body and Soul ENT: Two Days and Two Nights Singularity This Ain't the Valentine (they had to be kidding)
I'm enormously fond of "Explorers" for comedy -- I lose it when Bashir and O'Brien get drunk and wail out "Jerusalem". That's how I learned that song.
The entire scene in the messroom on the Klingon ship in Matter of Honor is the only piece of Trek that literally makes me "laugh out loud". Klag asking Riker if he needs a female to breastfeed him. Riker indicating that he could handle two Klingon women in the bedroom. Feels very natural and unforced, unlike alot of Trek "humour". Great scene.