Depending on your hosting situation, it is possible to create your own automatic custom SQL badges - Triggered custom badge queries
Though it’s also possible to run a similar custom query in the Data Explorer, and export the results as a CSV to feed into the Bulk Awarder on the relevant badge page. @pfaffman also recently suggested this process may be able to be finessed with use of the api, but I haven’t explored that option yet.
I think the missing link is then how to add these badged users automatically to a group. Possibly the automation plugin, as @nolo suggested, or maybe using the api?