If you are using a DB_PREFIX, the following SQL will not run (and will return an error).

PHP Code:
#NEXT_X_ROWS_AS_ONE_COMMAND:2
DELETE FROM `configuration_groupWHERE NOT IN (
SELECT `configuration_group_idFROM `configurationWHERE 1); 
The problem is on line 265:
PHP Code:
case (substr($line_upper08) == 'SELECT (' && substr_count($line,'FROM ')>0): 
change this to:

PHP Code:
case (substr($line_upper07) == 'SELECT ' && substr_count($line,'FROM ')>0):