Explaining a bit more it has a defun which is a little function that can contain like a 1000 lines of code but is called from the command line by typing resetbylayer, if you want it to run as part of load sequence hence the line (c:resetbylayer) without the double semicolon means run the defun, note its at end of code. A defun with c : means the name can be used as a command (defun restbylayer would need (resetbylayer) to work within in a lisp program.
Using accoreconsole is super fast, it edits a dwg without opening, you have to call a script so in this case the script file would have (load "resetbylayer") alternatively the script could just have.
(command "_.setbylayer" (ssget "_A" '((0 . "*TEXT")(8 . "12"))) "" "" "")
save
Close
https://through-the-interface.typepad.com/through_the_interface/2012/02/the-autocad-2013-core-console.html
For this task I am old fashioned and use a CMD DOS function dir *.dwg >dwglst.txt /b to make a list of all the dwg's and use Word to convert to a script, get a coffee and watch or if lots go to lunch. PS always backup beforehand.