Iran and Pakistan unite? I doubt it. Iran has always been pro-India, and has made this very clear by its actions on several occassions. Although Iran and India have distanced now that Iran has seen India's true colours (when India bowed to US pressure to vote against Iran at the UN while Pakistan abstained), I find it hard to imagine that the Pakistani government would forget Iran's track record regarding Pakistan very easily.
That said, the Pakistani people feel very close to Iran inspite of the Shiia-Sunni divide, especially after Iran's admirable stand against the US. In the event of a US attack on Iran, thousands of Pakistanis will most likely cross over through the porous Iran-Pakistan border to fight. That then might lead to far-reaching results.
The Pakistan-Afghanistan unification has been floated many times. This too now seems unlikely in light of Musharraf's support of Bush in Afghanistan, and the Afghani government's shameful attitude towards Pakistan (trying to make Pak the scapegoat for its own ineptitude, allowing Indian consulates inside Afghanistan which take advantage of the porous Durand line to send terrorists into Pakistan, completely ignoring how Pakistan has hosted more than 2 million Afghan refugess for more than 20 years who have been a huge burden on Pakistan's already weak economy).