The Egyptians believed that the Israelis were preparing an invasion of Syria, so the Egyptians moved their own force into the Sinai peninsula, in order to deter Israel. However, the Egyptian force was nowhere near sufficient to launch an invasion of Israel.
The closing of the Straits of Tiran was politically significant, but not very economically significant. Only a tiny fraction of Israel's trade went through the straits.
The Israelis had been planning a first strike on Egypt for a long time. Whether they actually feared an imminent Egyptian invasion in June 1967 is questionable. The Israeli military was very confident of its superiority over the Arab forces, and it may have simply taken advantage of the situation to land a devastating blow against the Arabs.
So it was just a coincidence that Egypt had massed troops on the border, closed the Straits of Tiran to Israeli shipping, and ejected UN security forces two weeks before that?