In T422685: Activity based user group membership I'm proposing to do what is essentially a generic, MW core implementation of T375115: Automatically revoke temporary-account-viewer group from users when they have not made an edit or logged action in the last year, which itself is an enhancement of temporary user group membership.
If/when whatever is implemented in core, the specific implementation in CheckUser should be updated to use whatever MW core is providing. Which potentially includes removing the CU specific purpose maintenance script for purging expiry etc.