Hmm. I didn't say "tell the truth". I said "Don't lie". You may construe that however you want, I guess.
I don't see how all of what you described couldn't also happen if you just didn't say anything. The difference would be that you now have no contradictory statements or evidence.
If you've made no statements, you can't be charged with lying (whether the charge is actually true or not), unless you say they lie about you making statements.