I must say that Pakistan has played this delicate balance of being an ally of both China and USA for quite long.
How long it can be sustained is for time to tell. A lesser player would have given up long back.
True. Here are the long-term trends:
The US and Europe are economically declining. Even if China slows down, it may become the world's largest economy over the next couple of decades. The political philosophy of the western powers is to work towards a unipolar world order. There is a desire to be the world's policeman, which will not be possible once they are no longer the primary economic power. When China gives loans to people like Mugabe of Zimbabwe, western powers resent it.
Thus, tension between the west and China is inevitable, and Pakistan is trying to balance.