If the history of China shows us one thing, that one thing is very clearly that foreign policy is always subordinate to the domestic concerns of keeping the population content and well-fed, and that China has historically always been so big that they quite had their hands full with that. Now of course China has become a global player, but foreign policy remains subordinate to domestic even so, and domestic concerns demand that stability and continued export relations with as many countries as possible are given the priority in foreign policy.
China would not be happy, to put it mildly, with an American/South-Korean attack on North-Korea, due to the perceived insult it implies to them and obviously due to the deployment of American troops so close to them. But it's absurd to suppose that they would go to war again on the North-Korean side. They have no interest in isolating themselves diplomatically and, as an inevitable consequence, economically, to such an extent. For the same reason, even if you suppose China would instead take on North-Korea itself, it would not be nearly crazy enough to invade South-Korea in the process. It's one thing to talk tough and demand to be treated with the respect due to a superpower, but quite another to go about attacking neighbours and making themselves look like a dangerous irresponsible state on whom you certainly don't want to rely too much for trade.