"Flashback" also botched the timeline rather horribly, showing that they didn't even bother watching ST VI past the opening five minutes. Kinda hard to respect the episode after picking up on that.
Well, it was pretty difficult respecting the whole Voyager series after they had an episode where crewmen turned into salamanders after going to Warp 10, so I feel for you.
DS9's "Trials and Tribble-ations" was much better.
They had the advantage of 1) Ron Moore and Rene Echevarria knowing "The Trouble With Tribbles" backwards and forwards, cold, and 2) having David Gerrold on the set.
As for "A Piece of the Action", even the director, James Komack, only said the script was "okay", and wasn't all that funny; it was the Star Trek cast doing all this outlandish stuff that made it funny, along with the cast willing to show off their comedic chops.