How did that "PURE" executables work in relation to this?
First, the PURE flag is just a pure indicator bit (no pun intended) for the resident program that is tested; trying to make a program resident with the pure flag cleared creates an error, but the resident program does actually not check for pure-ness in any other way. The ARP/Software distillery version of it had at least a checksum they tested for, but CBM removed that logic (but otherwise used lots of code from the software distillery to replace the tripos/BCPL code).
How other resident programs work is really program dependent. I personally avoid using global memory for such programs and put everything on the stack; there is no higher magic otherwise. Oh yes, probably avoid using code from the standard library. memcpy/strcpy and frieds are fine, but high-level stuff like printf()/fopen() are not. Use the dos PrintF() instead, for example.