Run the script better in DHCP Lease Script. We will be able to include/remove the IP-address to/from the group immediately when issuing an address or terminating a lease.
The global variables leaseActMAC and leaseActIP have addresses of the device. Using them we can find the option 82 agent-circuit-id and agent-remote-id in /ip dhcp-server lease. If the group name contains the agent-remote-id, then we can put the IP address in this address list. With agent-circuit-id, the situation is more complicated. By what algorithm do you want to determine which port to which list belongs?
Another option is possible. We can use the RADIUS server. Not for identification, but for collecting IP address database. After that, the script on the server (written for example on the python) looks in your other database to which address list the combination agent-circuit-id and agent-remote-id belongs. Then, using the Mikrotik AP , add this address to the desired list.
If you are interested write to me. We will discuss the algorithm and then adjust the time and money.