* casts Deus Ex Machina *
In its current state it seems approve-friendly. I will approve it.
You should consider that maybe a filter could be useful so that in certain hypothetical maps, units that keep getting changed colors periodically but do not use this do not harm performance too much.
Perhaps you could use a third static condition to use a native hashtable. I would prefer it to use AutoIndex or Table instead of messing with the hashtable limit, but I guess others would disagree.