We have SetAltMinimapIcon to set one alternative icon at a time and UnitSetUsesAltIcon to make units use the alternative icon or not.
Then we have about 5 more rarely used minimap icons you can use for you own purposes if you want, e.g. the goldmine ones, and that's it.
To my knowledge nobody has made a system out of it and I don't see the point making one.
But you might want to clarify your question as I do not understand what you mean by "make a system that loops through tons of icons".