The Iranian plan COULD be to scuttle the ships in the canal, thus closing it.
If the Iranians were going to scuttle ships in the Suez or use a ship to deliver a nuclear warhead to an Israeli port, they wouldn’t be using warships. Tankers or container ships could do the same job, but would be much cheaper, more easily replaced, and would attract less attention before they accomplished their mission. Iran’s warships are too valuable to be needlessly sacrificed, and the Israelis would never let an Iranian warship put in to an Israeli port.
This is more likely either a political gesture or an attempt to provoke the Israelis into attacking their ships in international waters. They also may be delivering reactor parts or some other sort of sensitive cargo to Syria, believing that a civilian freighter would be boarded and searched by the Israelis.