If you can be legally compelled to provide what's in your mind (password) and what's in your pocket (2FA device) then what's to stop them from compelling you to instruct your legal counsel (or whoever else is providing your "login escrow") to comply as well? It sounds like a ludicrous request but it's still in the realm of possibility.
Could they compel your lawyer to respond to your (under duress) request? Your lawyer would know, unless they could also make you not inform your lawyer that you were being detained. I hope that is not legally possible.
That's a thing actually. The IEEE code of ethics specifically forbids lying about technology. If I receive a national security letter about a technology issue, do I have to quit the IEEE? Can I explain to them that I have taken an earlier oath and that it takes precedence?
Instead, I would recommend resigning publicly from the IEEE by posting a message where it can be widely seen stating "I am forced to resign from the IEEE because my government has compelled me to violate the IEEE code of ethics. I am forbidden by law from explaining my actions."
Depends on the situation. If they asked you to install a backdoor, or weaken encryption then yeah I would say it violates IEEE ethics. If it was changing company policy to allow more people(the NSA) to access data, then that is not a technological change and not against (that particular) ethical guideline.