Going back to the OP. I was a prior Security Policeman and have served in a couple of different military branches. I don't know how it is with state troopers but I've been given unlawful orders and told the person ordering me to pound sand. I've also been given some pretty nice attaboys from high ranking folks for doing so. Nobody should be above the law including the law enforcers and people ordering the law enforcers.
This is an issue that has come to light more often than not, recently. The initial comment from the trooper was ill advised. While the position, and the attitude, of most street officers is that they must seize control of the situation and then attempt to sort it all out prevailing today, it is usually best to go along as well as you can with the officer on the scene. Police officers are human and we are prone to the occaisional mistake just like everyone else. Case law has supported an officer making a decision on the street that maybe should have been done differently, but stod in court because the officer was able to verbalize the intent, the situation as they saw it and whether or not they felt they were in danger. Remember that intent has a lot of weight in court. Do police officers overstep their authority? Every day. The over stepping of authority is where the legal vs illegal order comes into play. If an officer tells you to do something that you believe to be wrong, it is best to comply and wait for the opportunity to voice any objections at such time that you can do so safely. I have backed up fellow officers and observed them taking actions or saying something that I would not, but helped them until such time as i could point it out to them safely. Usually after the subject was restrained and in the back of the patrol car. SCOTUS has ruled that an individual can be placed in restraint and placed in a position/place of safety while an officer investigates a situation. Then, the subject can be released if the officer determines no wrong doing has occured. Meanwhile, it is entirely possible an unlawful order has been issued by the police officer.
Of course cops can make unlawful statements directing citizens to do something...we do hear of a cop abusing his authority in some way (e.g., sexual assault under color of law happens) more often than we care to think. But yeah...as a rule of thumb, comply first and sue later if you're not being placed in danger.