Did I see your name in my hub? Or the forum?
There are going to be moments like this (possibly everyday) coming in the foreseeable future, sorry to be the bearer of bad news. You're on the right track - you leave him in a safe environment until you both calm down. There are times when I actually go and lock myself in the toilet because I know they can't follow!
And there are things that would have made me pull my hair out if my first child had done it - now I actually find myself reaching for the camera! You need a sense of humor, you need to be objective. You know..the whole lose the battle, win the war concept.
There's a lot to be said for diffusing the problem before it escalates - distraction, removing the source of stress or removing yourselves from that environment. Just set a good example and be engaging with your son and you'll be great. Good luck!!