Pakistan is facing a delicate balancing act after emerging as an unlikely liaison between Donald Trump and Tehran—and taking advantage of a new transactional model of diplomacy under the U.S. President.

Islamabad is happy to give the U.S. president the image he craves.

Prior to this episode of mediation, Pakistan neither had experience, nor the kind of relationship with Iran that can be viewed as a desirable precursor for launching such a…