Hi Mark,
Actually, you should be using the "raw cfa" input hints in your script. This will ensure that raw CFA data are loaded unaltered as grayscale images, irrespective of user settings.
I look forward to your script. Please let me know if you need more information, or if you have more questions. Sorry for the slow response; I have been absolutely overwhelmed working on the next version of PixInsight (perhaps the most difficult and complex release since I began working on PixInsight in 2003).