definitely when a war between Pakistan and India happens, this time China will participate.
China is a mature country led by mature international-minded politicians. You can rest assured that China will stop you from making aggression, and India is not supposed to invade your country unless your agents cross the international boundary or the LoC.
China will certainly know who is the aggressor. And, in case Pakistan is the aggressor, it will not send its troops. Even if India is the aggressor, it is possible China will do the same. China's policy is not to get involved in some other countries' wars, except possibly North Korea.
China doesnt want to rely on the Straits of Malacca alone because of the Indo-Pacific Command which India is a part of.
Look at the map of China. Its main business center is along the eastern Sea coast where the population is dense. Uighur and Tibet in your north are too sparsely populated. China will use Gwaddar to transport goods to and from Tibet, because it is prohibitively expensive to transport them to the industrial east. Therefore, Gwaddar is good for transport to only these two mountainous regions.
So, China will certainly keep on using Malacca Strait and it will use other routes via Burma that connects its middle south like Kunming and the region surrounding it. Gwaddar to Kunming is a very long route and is thus very expensive to transport goods to and from the Kunming area.
Pakistani people are over-dreaming over Gwaddar and CPEC. CPEC does not foresee industrial belt built by the Chinese companies. It says about building highway and port infrastructues.
I think Pakistan will have to build its own industries by investing its own money. There is no free launch in the bilateral relationship. I read news China wants special guarntee (not just a Sovereign Guarantee writtn on paper) before lending $6 billion to Pakistan.
I have a feeling, China wants to barter a part of your sovereignty in the north in exchange. May be I am wrong, but I will not be surprised if this is the reality. Pakistan must gather its own resources and manpower to do economic activities instead of relying on China's goodwill.