It's not a burn, your dragon is choking, possibly to death, from the substrate. You said he has walnut or whatever in his mouth and he's running around shaking his head and running into things and coughing?
The reason why he is running around and shaking and bobbing his head is because he has something stuck in this throat and is trying to clear his airway. He's black from the stress and the lack of air, not from the burns. The coughing sound is him trying to get whatever is stuck in his throat out.
You need to gently with a cuetip or something soft pry his mouth open and check to see what it is. Take a pair of tweezers and gently pull whatever it is out and get him some air if he's still choking and alive. Turn him upside down when you do this and gently shake his head (GENTLY) and help coax whatever is there out.
I had a weak dragon I bought from some loser do this on collard greens. I got a call to come home he was dead/dying. When I picked him out of the cage he was 95% black, eyes would not open, and cold. I shoook him softly and he flicked an eye open but would not move. I soaked him in some water and he came back some and started shaking his head. Figured I would check for blockage as a guess, sure enough a piece of green was stuck in his throat. I did what I said above and pulled out like 4 pieces of collard greens. He fought and bit and broke one of his teeth and it bled some, but I did it as gently as I could and after about 5 minutes of careful working I got everything out. Put him back on some newspaper with a warm spot and left him alone to minimize the stress. After about 5 minutes I peeked around the corner into his cage and his color was coming back but he looked so weak his eyes were closed. I was 99% sure either he would be dead from the air or the stree when i got hom. The next morning he was fine. Took him a few days to get back to normal, but after tht he's been fine.
If he's burned, he would have sores and disfiguration and everything else. You really need to get a good caresheet if you are using a heat rock and walnut shells in your enclosure. God only knows what else the pet store told you to do. Hope he is okay for you.
brandon
-----
Dragons by Nature