Either reinitialize acaddoc.lsp after custom routine finish, or just put those lines at the very end of problematic ones you are working with...
I use acaddoc.lsp like single defined (_autoload_) function : (defun _autoload_ ( / ... ) ... ) and at the end I just call it once with (_autoload_)... Whenever I need partial autoload, I have dialog box and press Cancel so only my custom testing routines stored in appload.dfs placed in (getvar (quote roamablerootprefix)) are initialized, else if I press OK, I load all working environment ones that are placed in my support folder - all essential ones : drafting, ploting, designing 2D/3D,...
System variables such as OSNAPZ are hardcoded in acaddoc.lsp independently of function that is used for autoload of other routines, so that's connected with my preferred working habbit and custom CAD optimization for fast and effective workflow... So, IMHO, there is no need to worry about things how CAD work after custom executions, as you can either call reinit with (_autoload_) at command prompt, or just hardcode sequence at the very end of each of your problematic applications, or even better write just separate single one that'll have those syntax lines and after executions, initialize it like macro or one among others bounded within (_autoload_) inside acaddoc.lsp - if you wish it not autoloaded, use (autoload) function instead of (load) which is what I prefer...
HTH.