Summary
In thold_functions.php (line ~3330), the carefully computed $ra (re-alert flag) for type 2 warnings gets unconditionally overwritten:
// Carefully computed using lastemailtime + realerttime window:
$ra = ($warning_failures > $warning_trigger && $thold_data['time_warning_fail_length']
&& !empty($lastemailtime) && ($lastemailtime + $realerttime <= time()));
// ... lots of code using $ra ...
// Then unconditionally OVERWRITTEN:
$ra = ($warning_failures > $warning_trigger) ? true : false;
The time-window check is discarded. The subject line says "is still" (re-alert phrasing) any time failures exceed trigger, even if the re-alert window has not elapsed. The thold_action hook also receives the wrong repeat_alert value.
Fix
Remove the second $ra assignment or move it before the first computation.