You're right that it might not affect people's impulsive desire for revenge, but a declaration does affect whether the US or Iran can claim any moral high ground that would sustain such an impulse. Targeting foreign leaders is only permissible in war. The legal term is "jus in bello" but it's not applicable without a declaration. Trump's tweet, belligerent as it was, wasn't even structured as a declaration and wouldn't have counted if it was. By violating both international law and our own law (congress's sole prerogative to declare war plus EO12333 explicitly forbidding assassination), we have magnified the threat to the people of Iran and bolstered any claim they might make that their response is justified as self-defense (which international law allows even outside of formal war).