The statement was notable given Mr. Trump’s repeated assertions that a war with Iran was necessary to head off what he said was an imminent threat from the Islamic Republic