Data's Day and Matter of Time might not strictly be referred to as comedies so much as 'light hearted episodes', or episodes with humorous B-plots.
Data's perspective in Data's Day is rather humorous, particularly his musings on O'Brien's wedding. The dancing, his delivery of the 'good news'.
And A Matter of Time, the entire con is humorous. His questioning of the layout of the briefing room, his entire act.