In T239470#5723059 a list of items that have "holes" during the rebuild of terms table have been identified.
The rebuildItemTerms.php script has no way to work from this list, thus the script need to be modified to take input from a list in this format.
The script, when reading from a list such as this, should also be able to resume work after it has stopped from the correct position
(perhaps the list needs to be ordered or sorted at run time)