No, no, it's a continuation of the Uhura quote from Star Trek III.
She's wielding a phaser on another officer, and he asks why. She gives the response I quoted, and then tells him to sit in the closet.
It's actually not a reference to anything else, just that one scene. A joke, really...