TAPI is not only viable, it makes great geo-strategic sense as well.
Afghanistan can not forever stay in this state. Its only projects like these that create linkages and economic incentives to improve cooperation and encourage stability.
People need to think a little and be willing to step out of their shells before letting their itchy fingers get the better of them.
What strategic interest is there in propping up Tajikistan when it's in the claws of Russia? A Pro-Russian country that gladly let its own land be used in the Soviet-Afghan war to help India-Russia, an ally of a country that caused the break up off East-Pakistan, but you expect them not to cave into foreign pressure in order to turn off the oil supply if a war between Pakistan-India ensues?
Since Pakistan's inception, Afghanistan has never come to the table thanks to Pakistan's inability to deal in a diplomatic manner with all the parties in that country. For over seventy years the Pakistan-Afghanistan relationship has been dire. To assume that a pipeline fixes that is absurd.
Iran is pivotal to Pakistan and its energy supply route:
Independent - In its current state it wont be held hostage by a third party to turn off supply in eventuality of war with India
Secure - It crosses no third country like TAPI, less parties able to sabotage the energy pipeline
Cheaper energy prices - Eventually a connection to mainland China via Xinjiang and poss India via Lahore. A connection of TAPI doesn't involve China[makes no sense too, either] and do no transit fees to be gained
China - Less reliance on the Malacca strait, securing China's energy interest, acting as a gateway and bringing Iran into the fold helping forge strong + cohesive ties between the three countries and enabling Pakistan to have more influence.
Formation of strong ECO ties - Alongside Turkey negating Russia influence in Central Asia
Balochistan - Security
Afghanistan - A landlocked country helpless either way it has to work with Iran or Pakistan. Afghanistan either gets along with us or an ally in Iran. Enabling a favourable outcome either way
India - Curbing their influence, at the moment, they have little to no clout but that can all change should Pakistan persist to cast Iran aside. Pakistan cant afford problems with all the neighbours on our Eastern and Western front
That's just to name a few. There's no comparison to be made between TAPI and the IP pipeline in terms of Pakistans' interests. Iran is too important to Pakistan.