You basically take a range of numbers that represent note values (i.e. 0 to 7 for one octave in a major scale) and scale it to a range that is appropriate for the modulation depth. [maxlib/scale] does the math for you, you just need to give it the ranges. You would then just connect that to wherever the modulation depth is in the patch, since modulation depth can be thought of as adjusting the brightness in FM.
As for the automated scale, you should look into using arrays and [tabread] (and if your professor is having you do something as advanced as FM synthesis, you should probably already be familiar with these). You could store the note numbers of a C Major scale in an array (they can be MIDI if you prefer) and use a counter or random values or whatever to read the notes.