Timed publishing and unpublishing of pages

I am now using this

$eventName = $modx->event->name;
switch($eventName) {
    case 'OnLoadWebDocument':
        $blocked_resource_ids = [32,33]; //IDs of resources to block access to
        $current_resource_id = $modx->resource->get('id');
        
        if (in_array($current_resource_id, $blocked_resource_ids)){
            $day = (int)date('w'); //A numeric representation of the day (0 for Sunday, 6 for Saturday)
            $hour = (int)date('G'); //24-hour format of an hour (0 to 23)
            
            $block_access = false;
            //Mon, Tue, Wed, Thur (20:00 to 20:59:59) 
            if (in_array($day,[1,2,3,4]) && $hour == 20){
                $block_access = true;
            }
            //Sat 18:00 - 21:59:59
            if ($day == 6 && $hour >= 18 && $hour < 22){
                $block_access = true;
            }
                
            if ($block_access) {
                $modx->log(modX::LOG_LEVEL_ERROR,'Access blocked to resource ' . $current_resource_id); //Write message to error log
                $redirect_id = $modx->getOption('site_unavailable_page',null,1); //read system setting 'site_unavailable_page'
                $modx->sendForward($redirect_id);
            }
        }
        break;
}

Pages are not being blocked

As Bob pointed out, I misread your intention. I erroneously tought you wanted to block access for an hour a day and not allow it. Therefore $block_access = true; and $block_access = false; have to be reversed.
Try this:

<?php
$eventName = $modx->event->name;
switch($eventName) {
    case 'OnLoadWebDocument':
        $blocked_resource_ids = [32,33]; //IDs of resources to block access to
        $current_resource_id = $modx->resource->get('id');
        
        if (in_array($current_resource_id, $blocked_resource_ids)){
			/* This won't be necessary if PHP's time is correct for your timezone */
			date_default_timezone_set('Europe/London'); 
            $day = (int)date('w'); //A numeric representation of the day (0 for Sunday, 6 for Saturday)
            $hour = (int)date('G'); //24-hour format of an hour (0 to 23)
            
            $block_access = true;
            //Mon, Tue, Wed, Thur (20:00 to 20:59:59) 
            if (in_array($day,[1,2,3,4]) && $hour == 20){
                $block_access = false;
            }
            //Sat 18:00 - 21:59:59
            if ($day == 6 && $hour >= 18 && $hour < 22){
                $block_access = false;
            }
                
            if ($block_access) {
                //$modx->log(modX::LOG_LEVEL_ERROR,'Access blocked to resource ' . $current_resource_id); //Write message to error log
                $redirect_id = 36;
                $modx->sendForward($redirect_id);
				//$redirect_url = $modx->makeUrl($redirect_id);
				//$modx->sendRedirect($redirect_url);
            }
        }
        break;
}

@halftrainedharry Thanks very much, that works.

@bobray Thanks very much this is working well