We had a suite of lisps and ran them on Intellicad and had that type of problem with say 3 lisps, we basically rewrote them to match Intellicad and saved them elsewhere. We had a installer that copied correct versions etc. We had a couple of others that we just rewrote to match Acad and Icad had some help from another developer.
As already mentioned you could set a variable and check it all the time then use a cond, but it means some code will have like 3 lines for same function.
Unfortunately it can be a bit of trial and error to find the problem commands.