I have uploaded a version that I use that does a decent amount of error checking prior to running the commands to ensure that there are no issues. It also incorporates fixes for a lot of the questions and concerns voiced here.
This is a great function for saving time when you are doing trial-and-error type coding with figures and need to run an m file over and over again as you tweak it. i actually had a script version of this named 'gameover' but 'clr' is nice and curt. this function won't appeal to users like Jan that are doing debugging.
You forgot to mention that "clear('all')" removes all loaded functions from the memory and that reloading them is very time-consuming. Because all PERSISTENT variables are cleared also, function may need a new initialization also.
clear('all') is useful, if you have modified all(!) M-files during a program runs and you need to use the new functions - a very rare situation.
In addition the result of clear('all') can be surprising, if there is a variable called "all" in the workspace.
pack() and fclose('all') could be considered also. A situation where I need a reset is a crashing CloseRequestFcn, which prevent the regular removing of a window. Then close('all') will fail also and a more powerful method is required.
My opinion is, that this function is to brute for standard cases and to weak for hard cases.