you might should add some note that when using Integer A/B you have to do this:

Custom script: set bj_forLoopAIndexEnd = bj_forLoopAIndexEnd - 1
or that:

Custom script: set bj_forLoopBIndexEnd = bj_forLoopBIndexEnd - 1
cause the internal counter won't be reduced the other way
and if the last slot is empty and the current slot runs out the last slot will only be recycled after the whole thing started again
Example:
(0 means the slot is empty)
1 0
2 0
3 0
slot 1 is replaced with slot 3 and index reduced to
3 0
2 0
slot 2 will be deleted
3 0
trigger runs again
-
and just by now the third slot got removed
this might sound like a minor bug while everything is executed every 0.03 sec but imagine a trigger running every minute or a trigger running every 0.03 sec with 1000 slots
I'd recommend setting the counter variable to counter - 1 too
however I probably did not understand it fully
I'd do it like that: