Added the Feature (delete only if enabled) for both Scripts.
Script 1:
#---------------------------------------
# Set IP-Addresses to Remove from Address-List
:local A2R 4.4.4.0/24
#---------------------------------------
/ip firewall address-list remove [find where address in $A2R && disabled=no]
Script 2:
#---------------------------------------
# Set IP-Addresses to KEEP from Address-List
:local A2R {2.2.2.0/24;8.8.8.0/24;1.1.1.0/24}
#---------------------------------------
:local KeepIP
:foreach i in=[/ip firewall address-list find where disabled=no] do={
:set $KeepIP ""
:foreach j in=$A2R do={
:if ([/ip firewall address-list get $i address] in $j) do={
:set $KeepIP true
}
}
:if (!($KeepIP = true)) do={/ip firewall address-list remove $i}
}