I dont think i would do this through the database, using the database would require a query on every protected page, that would add a lot of traffic to the database, on a busy site, that could add up.
you could create a file in your site that you attach to all of the pages at line 1 before any of the security assist code to set a session to 1 or 0:
<?php
@session_start();
$_SESSION['makeProtected'] = "1";
?>
then add an if statement around the security assist page access code so it will be bypassed if the makeProtected session is not 1:
<?php if(isset($_SESSION['makeProtected']) && $_SESSION['makeProtected'] == "1") { ?>
<?php
if (!WA_Auth_RulePasses("Logged in to visitors")){
WA_Auth_RestrictAccess("login.php");
}
?>
<?php } ?>
to unlock the pages, set the makeProtected session to something other than 1.