Well there's no direct method. But you can try using the Icall method to update your configurations.
All you have to do is 1st log the IP & throw a log to trigger the icall script. And once Icall is triggered, you'll have to execute your cmd to update the datagroup. You can rather form a script to update the datagroup, it will be better if you use an external datagroup in this matter. You'll also need to put filters to extract the IP's or log these in some particular files, in that way you dont have to frame much filters.
But the problem comes on how often you would obtain the IP's & how often we would need to run the script. If its real time, i dont think its recommended to do this way, you'll have to run a comparison check against your existing data 1st, use catch condition, if its not present, then only trigger the icall.
If its certain interval, you can simply log them 1st. Put a cronjob to run a script to update the datagroup. But this doesn't involve the Irule as per your requirement.