Either you have to change the code to use none of the Electrical commands ( as I'm sure they are coded to only use the current drawing ), and no ' ssget ' calls, or...
You can use a lisp on multiple files, if you use Acad in SDI mode, or....
You can create a lisp, that will write a script, that will run your commands ( lisps and/or commands ), but this cannot have any user interactions.