Distractions are good: someone suggested giving my son a square of bubble wrap to pop when we're about to do something that might set him off (e.g. go to school)
We also made up a family contract with the agreement that it is his responsibility to go to his room on his own when we ask him. We practice this regularly: first thing I say when he's amping up is "go to your room" (before we get to the state where he can't do it) We also had him discuss the physical warning symptoms before he gets agitated, and have asked him to remove himself when he feels those symptoms (he said he gets a tight upper lip.) It's a major, major responsibility for him.
Also, one thing to remember is that kids on the spectrum have a developmental delay. This means that often, if you work at it carefully, they get there themselves. If you instill a habit for him to do this on his own now, he will likely internalize it before he's putting you or your home in danger.
I consider it a good sign that he was using soft objects, and that he could "snap out of it," but it's really important that he internalize a replacement behavior.