Hey there,
I am Abraham, Senior MikroTik engineer and Network consultant with 9+ years of telecom background and extensive mikrotik experiences.
please take a look at my profile for more detail and kindly contact me to discuss details.
BEst .Regards.
update: I've already wrote and tested your script for my own interest as midnight project.
you can message me in the morning to get it.