You see, that's an expletive. That's considered to be much milder than using the word sh*t do designate other things, which they do in this show, in episode 3, I think. And it's used in this fashion not once, but on several occasions. What Data said was uttered as a sort of shock and surprise, and, considering that he had his emotional chip turned on, it wouldn't be that surprising that some of those 21st century words stored in his positronic brain were retrieved and used at that moment. Besides, that expletive is masked by the surrounding noise to such an extent and uttered in such a quiet way that it almost goes unnoticed if one does not pay attention. So, it's not really a fitting example nor a justification for the aforementioned use in STP.