But the United States also sent secret messages through Swiss intermediaries urging Iran not to respond so forcefully that Mr. Trump would feel compelled to go even further. After it did respond, firing 16 missiles at bases housing American troops without hurting anyone as a relatively harmless show of force, a message came back through the Swiss saying that would be the end of its reprisal for now. The message, forwarded to Washington within five minutes after it was received, persuaded the president to stand down.