The reason it doesn’t work is that you’re iterating the aliases for the subtexture slots property (which are defined up until the default value of 20) instead of the actual property.
In short - $.material.texmap_diffuse.color_n instead of $.material.texmap_diffuse.texmap_color (where n = the slot id).
If you change your code like this, it should work:
$.material.texmap_diffuse.addSubtex 80
for i = 1 to 100 do
(
execute ("$.material.texmap_diffuse.texmap_color["+ i as string + "]" = (color 0 0 0)")
)