Change: round(random(0,HBlockLineRepeatCount-1))
to: round(random(0,HBlockLinePositions.Width-1))
Since the array keeps getting smaller, you need to account for the changing size, which your global does not.
C2 continually runs your script. You need to alter your events to only run when required. You can use functions to do this. Fill would then get called on startup, and Random whenever you needed it.