data.raw["planet"]["vulcanus"].map_gen_settings.territory_settings.units
is the list where all enemies are listed that get put in a territory on vulcanus
data.raw["noise-expression"]["demolisher_variation_expression"].expression
is a integer-step function that returns a index based on the distance (can be found in planet-vulcanus-map-gen.lua on the bottom).
For near values you get 1 (first unit of the list on the top i.e small-demolisher) and for far distances it goes up. So eventually the value of the function is 4 and you get my behemoth-demolishers for far distances (its the 4th element of the list).
i dont know how you can add quality to this. You can only put the name of the unit in the list on the top and no additional attributes (i.e no quality?) (I have not tried anything else)
so in my case: table.insert(data.raw["planet"]["vulcanus"].map_gen_settings.territory_settings.units, "behemoth-demolisher")