It would be interesting to adapt this script to be used for ease of use of the programmer rather than for level scaling. A lot of people (well, me personally sometimes, and, by extension, probably others. Unless I'm just terribly incompetent. >.<) sometimes have trouble knowing exactly how difficult to make the enemies in a given area of the game that will help them to be challenging but not frustrating. The ideal solution is to make creative enemies that use unique tactics, abilities, and so on.
However, if, for example, you're creating an area with only a minor role in the story, but want to be able to populate it with some quickly-made monsters, you could have the script generate enemies at the appropriate level relative to the area. Of course, you'd still probably want to have at least unique names and color schemes for the enemies so as not to ever cross the line of being downright lazy, but this would at least take some of the arithmetic and testing out of the picture.
Sorry for the rambling - just a thought I had as I was looking through the script.