Well, I found my own answer (it’s the golden rule of programming – you can look for hours for the answer and then as soon as you ask someone else for help it just pops in front of you).
It’s the setInterpolationTypeAtKey() method.
A quick example for anyone who encountered the same problem and would like a brief bit of code to nibble on:
var layerVar = app.project.activeItem.layer(layerLoopCount);
var layerMasks = layerVar.property(“Masks”);
var currentMask = layerVar.mask(1);
var maskOpacity = currentMask(“Mask Opacity”);
maskOpacity.setValueAtTime(0, 100); // creates a mask at frame 0 with opacity 100
maskOpacity.setInterpolationTypeAtKey(1, KeyframeInterpolationType.HOLD); // sets the interpolation type of the 1st keyframe in the mask to hold
The documentation was found on page 133 of the CS3 Adobe After Effects Professional Scripting Guide: https://www.adobe.com/products/aftereffects/pdfs/aftereffectscs3_scripting_guide.pdf