The president’s threat to intervene came as Tehran’s hard-liners promised a harsher crackdown if demonstrations spiraled out of control.