I have refined the script again. Now you can block certain ip-ranges from ever making it to list-2 (blocklist).
You can do this by creating a static /24 IP-range in list-1 then any IP address in that range will not be moved to list-2 despite it may have reach the threshold to be moved. So when you make an error in the rule and are adding IP addresses that are local or remote that should not be blocked you have now a extra security to avoid unwanted blocks.
## change to address-lists
/ip firewall address-list
## Loops through the address-list till all entries are handled
:foreach b in=[find where list="list-1" dynamic] do={:set $firstAddress [get value-name=address number=$b]
## convert address in list to ip range of /24
:local ipRange (($firstAddress&255.255.255.0)."/24")
## Check if that address range is blocked by a static enty
:if ([find where list="list-1" address=$ipRange !dynamic]) do={remove [find where list=list-1 address=$firstAddress] ; \
:log warning "$firstAddress was blocked by Static entry on list-1" } else {
## resets the counter
:local countRange 0;
## Counts how many addresses are in the range
:foreach c in=[find where list=list-1 address in $ipRange] do={ :set countRange ($countRange + 1)};
## If more than five times the same IP address range is matched then it is added added to list-2
## else remove the used range from the list-1 because any other hits are with too less.
:if ($countRange > 4) do={add address=$ipRange list=list-2; ; remove [find where list=list-1 && address in $ipRange] ; \
:log warning "$ipRange range added to list-2" } else={remove [find where list=list-1 && address in $ipRange]};
}; # foreach b
}; # if else