I didn’t think you were a dick at all. I think a good comment you could have made to them was,

“I wonder what the fall-out would be if an actual terrorist incident happens at this moment and you are caught being filmed spending way too long with a person who neither looks like a terrorist and you admittedly had no real suspicion about?”

It was obvious that he was just abusing his power to annoy you. I thought you were quite composed under the circumstances.