If I understand it correctly, you are wasting system memory if you skip them, however, it is going to be a very small amount. It should be noted that the size of the array increases only if it is not large enough to accommodate the index you are trying to use. It will skip to the next largest power of 2. In this case, your array is actually size 8 in the memory. Units are actually just unit handles, so you are essentially just storing one integer. 8 integers is very little memory. However, I imagine it could get bad if you had many hundred arrays and skipped to index 5000 or something. I think that is why unit indexers are typically quite aggressive with recycling.
I can't say I'm an expert on how WC3 works. This is just what I have picked up over time and from what I know about computers (from school etc.).