SQLBot calculates stale times based on active admins in the last hour. This is done using this query.

As active admins approaches 40, the stale timeframe will stretch to 8 hours.

As active admins approaches 80, the stale timeframe will shrink to 4 hours.

The actual function used here is ($active is a whole number which will be a result of that query, and presently $timeLimit is 6, reflecting the base stale time in hours):

$diff = abs( round( 60 - $active, 0 ) );
if( $diff > 20 ) { $diff = 20; }
$offset = ( $diff * 6 ) / 60;
if( $active < 60 ) {
	$timeLimit = $timeLimit + $offset;
} elseif( $active > 60 ) {
	$timeLimit = $timeLimit - $offset;
}

This is based on watching the average active admins by hour over a long period [1].