Use /tool netwatch to run the relevant script as per the status
We do it here all the time for monitoring the status of the parent proxy. If parent proxy goes down then a script is executed which resets the Parent Proxy parameter to default and once it goes up again sets it back.
you have to use Sustem Scheduler in this case. You should check for new pppoe connections every 59s (e.i. interval=59s), in this scheduled task use a script which is taking ‘uptime’ parameter for each pppoe client (from ‘/interface pppoe-server’ submenu) and if this uptime is less than 1min add firewall rules or whatever you need.
But you cannot catch the moment when this clients is getting disconnected, so
everything you added will be left and can be removed only manually.