I think it should have two lists: a white list and a black list. Each list is of groups. Then, you create a group (eg 20_posts_plus_group) and add that group to the white list. For moderators, you just add all moderators to the moderators group and then add them to the white list. This gives you much greater control.
Then, create a function (I did this in Notepad in a few seconds so it's just a concept):
var_dump(requiresPostVerification($user_info['groups']));
// Admin, Global Moderator, Moderator
$modSettings['post_verification_whitelist'] = [1, 2, 3];
// Default Newbie Group and Guest
$modSettings['post_verification_blacklist'] = [-1, 4];
/**
* Check if a user is required to answer a human verification question
* @param array $groups The user's groups
* @return bool
*/
function requiresPostVerification(array $groups)
{
$whitelist = $GLOBALS['modSettings']['post_verficiation_whitelist'] ?: $GLOBALS['modSettings']['post_verficiation_whitelist'];
$blacklist = $GLOBALS['modSettings']['post_verification_blacklist'] ?: $GLOBALS['modSettings']['post_verification_blacklist'];
// Don't worry about the whitelist if they are on the blacklist. We want to be overly cautious
if (!empty($blacklist) && array() !== array_intersect($blacklist, $groups))
{
return true;
}
if (!empty($whitelist) && array() !== array_intersect($whitelist, $groups))
{
return true;
}
return false;
}