Save the state of a simulation is a build in function for simulation created with EJS.

You can download the jar file and double click it to run it.

Right click in the simulation region, and you will find menu to save the state of your simulations (you can save as many as you like).
You can load the state , and the simulation will be back to when it was saved.

I'd like to have the possibility to set the height of the work area, not just the scale with a slider that starts from 1 centimeter up to 20 centimeters

Would you like the range for width/height to be entered with numerical value instead of changed with slider?
What about the range for the wall ?(for particle to bounce up and down).