Alejandro,
Did you download the Examples Package? There are quite a few custom dialog source code projects that demonstrate exactly this.
BTW, in your screenshot you are not using any of the custom dialog techniques nor do you execute the custom code inside the "Loop Wizard".
I have developed a quick-and-dirty demo for you:
http://www.lindersoft.com/projects/ValidatePassword.zip
Does this help?
Friedrich