For the naming routine, I wrote what the player types in to variables 0x8000 to 0x8004. Each variable holds two letters. I then compare each variable to what two letters it should equal. The easiest way to do it is to use the memory viewer in VBA, switch it to 16 bit mode, navigate to those variables, type in what you want the password to be, and see what it sets the variables to after you hit enter.
A nicer alternative would be to write a routine that compares it to either a table, or maybe even bufferstring. While the variables is kind of awkward, it does have the bonus of making it harder for someone to look at the script to guess the password.
To show the naming box, use callasm. I also have to use waitstate right after, I think.