The problem is that many ont's restart up to 10 times in 1 minute filling the mikrotik with pppoe requests, I would like to make the secret of the user when detected in DOWN state is disabled for 10 to 20 seconds until it is valid again. I mean a script on the pppoe server. But I do not know how to do it
Well - is the first request hanging up correctly or does it sit there in 'timeout'? You could increase the keepalive/timeout and use One Session Per Host as an 'easy' workaround, as when it tries to connect again while the first session is still timing out then it won't let them on.
Alternatively per your request, you could have a on-down script
/ppp secret disable [ find name=$user ]
:delay 30s // This might need to be in ms
/ppp secret enable [ find name=$user ]
This is untested, and im not sure on if its a good idea to actually run such large delays on down scripts on PPP's - if it halts other processes or causes issues. It may be better to tag it with a comment and have a scheduled script come through every 60 seconds and enable everything with the tagged comment - but this will have a possibility of things only being disabled for a few seconds before being re-enabled depending on when in the 60 second wait time it happened.