you could maybe implement a linked list (LL)?
i.e. have an 3 extra values in your Zbuffer UDT like .ThisIndex, .NextIndex, and PrevIndex
this means that when you add entries to your array, you would need to manually manage these values as well.
i.e. first item would have .ThisIndex=1, .NextIndex=2, .PrevIndex=0; second item would have .ThisIndex=2, .NextIndex=3, .PrevIndex=1, etc.
Then when you what to insert an entry you just change the .NextIndex and .PrevIndex values of the current, next and previous items.
Note:The values for .ThisIndex, .NextIndex, and .PrevIndex are not really indexes but are really unique identifiers to uniquely identify each entry of the LL.
i.e. although it's easy to start at 1 and go 1,2,3,4,5 initially, when you start using the LL properly and add and delete entries, the actual sequential values may end up being for example 1,2,6,3,8,4,5, etc.
Hope this makes sense and helps you out.