http://www.goenglish.com/BiteYourTongue.asp
According to the link and other reference I read, I think this idiom is somewhat a negative response to ask somebody to shut their mouth. And the words coming from their mouth could be unpleasant to the listener's ear.
So,
If someone flatters me a lot, can I say, "Bite your tongue! I'm flattered."
If someone swears a lot, can I say, "Bite your tongue! Watch your mouth, lady."