Simple Queue data download limit

Greetings,

I have inherited management functions (free service from me to a local school) on a CRS109 which has simple queues set for each DHCP lease. The leases span 7 subnets, a historical issue I do not wish to change at this point. Being at a school, I have been asked to limit the download data levels at 250MB for each device.

I have tried this, and it fails, cannot figure out why. My scripting levels clearly not very good. Basically I am trying to get a script to run through every simple queue, grab the bytes and ip address, and after calculating the bytes down to “MB downloaded”, adding anyone with a value over 250MB to a firewall address list called Drops. The Firewall filter then drops all external traffic from these IP’s.

Running the script in terminal shows no errors, just it does nothing and appears to bomb out before the end.

#Data Limiting
/ip firewall address-list remove [/ip firewall address-list find list=Drops] 
/queue simple
:foreach z in=[find] do={
:local queuecomment [get $z comment]
:local ipadd [get $z target]
:local traf [get $z bytes]
:local megsd 0

:set megsd ((([:pick $traf ([:find $traf "/"]  +1) ([:len $traf])]) + ([:pick $traf 0 ([:find $traf "/"] )]))/1048576);
            :if ($megsd>250) do={
            :log error ("Dropping: " .  $queuecomment . $ipadd);
            /ip firewall address-list add list=Drops timeout=6h00m  address=$ipadd;
             }
             }
:log error "Data Cap Run Finished";

Any help in getting this to run would be greatly appreciated!

Thanks for your time
Brian