Tracing Response times and blocking

Hi everyone!

I was wondering. Is it possible to have a script to trace the response time of an IP after it has been added in the address list, and block it in the firewall if the IP has a slow response time?

To give an example:

IP xx.xx.xx.xx has been added in address list “Sampling” (IP | Firewall | Address list=“Sampling”)
Script runs let’s say every 10 minutes to measure response time of all IPs in list=“Sampling”
If the total response time (i.e. using traceroute) is > x ms, then block IP in firewall

Any one has any clue? Thanks in advance!!