No that won't work... you would need to hand edit and add the IF statement into the loop. So use a normal trigger:
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) // Trigger
Then later in the while loop wrap the line that does the insert with the category check like:
if ($pjCart->DisplayInfo("Category")==6) {
$WA_editCmd = mysql_query($WA_sql, $WA_connection) or die(mysql_error());
}