Why my script is not working?!

I want to use this script to make an address list of for example facebook servers.
But i don’t know what is my mistake that is not working.
Can someone help please.

# Script to add Facebook DNS IP addresses
# For Mikrotik 5.x
# Script Source: N/A / GOOGLE : )

:log warning "Script Started ... Adding Facebook DNS ip's to address list name facebook_dns_ips"
:foreach i in=[/ip dns cache find] do={
:local bNew true;
:local cacheName [/ip dns cache all get $i name] ;
:if ([:find $cacheName facebook] != 0) do={
:local tmpAddress [/ip dns cache get $i address] ;
:put $tmpAddress;
:if ( [/ip firewall address-list find ] = "") do={
:log info ("added entry:" . [/ip dns cache get $i name] ." IP " . $tmpAddress);
/ip firewall address-list add address=$tmpAddress list=facebook_dns_ips comment=$cacheName;
} else={
:foreach j in=[/ip firewall address-list find ] do={
:if ( [/ip firewall address-list get $j address] = $tmpAddress ) do={
:set bNew false;
}
}
:if ( $bNew = true ) do={
:log info ("added entry:" . [/ip dns cache get $i name] . " IP " . $tmpAddress);
/ip firewall address-list add address=$tmpAddress list=facebook_dns_ips
comment=$cacheName;
}
}
}
}
# FB DNS IP ADD Script Ended ...
}