Without seeing the code, I can't say exactly but here is my general idea.
A lot of this you probably have done in a different context as the game you describe sounds pretty complicated.
You need to create a variable that tracks whether the game should be playing or not.
Inside the draw function, create an if else statement that uses the variable above as the condition.
I guess other ways to do it would be to change the frameRate to zero (I've never tried this.)
var playing = true ;
// all of the code for the game when it is playing. Including an if statement that will change the variable playing to false.
//the code for when the game stops.
Let us know how it goes. It'd also be fun to add a link to the game.