Ok, first things first ...
In a script, if you call a lisp routine that requires user interaction, makes use of "command" or vl-cmdf, or if the lisp generates any error, the script will cease running.
secondly, if you insist upon running scripts that make use of command or vl-cmdf (I think there are a few others, but I cannot remember them at this time), you must edit your lisp routines to be able to interact with scripts.
Finally, you CAN make a simple change to your lisps to make them compatable, but it does not always work and can sometimes create unexpected results.
To fix them so they will work properly, edit the "layerdate" routine to include AS THE LAST LINE in the lisp
(vl-cmdf "_.RESUME")
Your scripts will operate as you expect, however, if there is a script that has been interrupted, it will begin execution from where it was interrupted, after running this lisp.
Example ...
You have a script that automates plotting .... after pressing enter, you realize you forgot to change something in the drawing .. rather than plot the things all out and throw them away, you press the ESC key to stop the script. You then begin editing the drawing, and find yourself in need of using the "layerdate" routine. As soon as you run the routine, the resume command is issued and suddenly, inexplicably, the plotting starts up where it left off when you previously cancelled it ...
So, you see it is not a silver bullet, but it will resolve the immediate issue at hand.