I can't see any syntax errors in the dialog part, but what is the if %pass1 == null echo -a 12,0 negativo  | return
line for, what do you have to trigger that line?
Do you mean $null not null?
What does the script not do that you expect it to?