I would do the transposition or constraining of the pitch either in the Frequency field of the synthesis module or in the KeyPitches array of the StepSequencer. To quantize to or transpose by a scale step, you might be able to use the Capytalk expression:
!aPitch transposeBySteps: !TrspScaleSteps0 scaleIndex: !ScaleIndex012 tonic: !aNoteNumber
For more details on how that expression works, you can open the Capytalk Reference and search for 'transpos'.
Alternatively, for other kinds of scales, you could search in the Capytalk Reference for:
!Step ofEuclideanScaleSteps: !StepsInScale octaves: !Octaves mode: !Mode stepsPerOctave: !StepsPerOctave
You might also find some useful expressions in the Tools menu > Design Alternate Tunings.