Can I create a plugin that checks users and grant access to group based on activity?

For custom Badges, when the ability to do so is enabled, queries can be put together and they will be routinely run, automatically granting / revoking Badges. Because a poorly written query can cause much pain, the ability requires some dev know how. Although Badges are under Admin, not all Admins are devs.

A similar feature for Groups would be a convenient UI, but would also present the same risks the Badge query UI presents.

A plugin that did not have a UI would be hacky but easier to write. The plugin could have the query(s) hard-coded and then there would need to be a way to have it run on schedule.