In TOS, there were a number of plot holes (e.g. in "Balance of Terror", Spock hitting a button that causes a beeper to go off, alerting the Romulan ship--this ignores the fact that sound doesn't travel in a vacuum).
While the sentiment may be correct, I have to disagree with the example.
While it's true that sound doesn't travel through space, even archaic 20th Century technology like laser microphone would detect Spock's beep. While it's true that the cloaked Romulan probably wouldn't be using such an active sensor, there could be a legitimate way of detecting such vibrations passively. Indeed it might be exactly these types of vibrations that the show refers to every time Spock says something like "I'm [not] detecting any life signs, captain". So that particular example is well within the framework of the Trek canon.