Hmmm China wants us to stay away....
You bet they do. I don't think China has any real control over the Norks but they will use whatever they do to push back against us and any influence the U.S. has in the orient, real or perceived.
If this situation breaks out into unrestrained conflict we should respond without any restraint at all. Devastate NK totally. Then make it clear to China that, while it was the only thing we could do to protect S. Korea, they can take it as a message in Beijing too. No apologies, no qualifications, no caveats at all.