Invece di stampare, attiva una variabile:
codice:
...
...
else
  
  bolErrorCognome = true
  
end if 
...
...


Dopo il Loop

if bolErrorCognome then  
  response.write "procedura bloccata per errore sul cognome" & "
"
end if 
...
...

Roby