>That's a problem but not one the article solves ...
Says who? There's nothing stopping you from repeating those same phrases the article details while in the company of people who you have no reason to suspect are federal agents, but could be.
For example, if your significant other is nagging or otherwise interrogating you: "I decline to be interviewed without a lawyer." If your SO turns out to be a federal agent, then the article just solved the problem. :)
Joking aside, though, if you said this to an undercover police-officer, I presume they wouldn't reveal themselves at the time—but would it taint any evidence they collected by talking to you after that point, the same way it would if you said it in an interview?
It doesn't always work, because sting operations often involve paid informants who are not police, but assist by luring offenders to a location that's under surveillance.
In such a situation, you might ask a similar question, receive an honest answer, and still get busted, because you participated in a transaction that was recorded by observers.
Plain clothes officers operating undercover aren't always placed in direct contact with targets at the moment of a bust. Sometimes they just need to gather enough information needed to orchestrate a bust, and then they just disappear, as if completely unconnected.