making a UI, and a drop-down menu

Hi! i like messing around with applescript, and ive made some applications so far (mostly with the help of this community).
My latest creation is a world of warcraft auto-login app. this is how it is so far:

-- WoWAL 2.0.applescript
-- WoWAL 2.0

--  Created by Keytachi on 11/22/07.
--  Copyright 2007 __KEMP__. All rights reserved.

property UN : missing value

if UN is missing value then
	display dialog "Please enter username" default answer ""
	set UN to text returned of result
end if

property PW : missing value

if PW is missing value then
	display dialog "Please enter password" default answer ""
	set PW to text returned of result
end if

set CR to ASCII character of 13
set TB to ASCII character of 9
tell application "System Events"
	tell application "World of Warcraft" to activate
	keystroke UN & TB & PW & CR
end tell

now i wanted to add multi user/password support, so that when you ran the app, you could choose a set from the list, or add a new one. thats my first item on the To Do list. the second item, is a UI, so its more user friendly.

i found this script in this site for the drop down menu:

set theReplies to {"boilerplate 1", "boilerplate 2", "boilerplate 3"}
set theChoice to (choose from list theReplies) as text
set thisReply to processChoice(theChoice)
set theMessage to "Dear " & (text returned of (display dialog "enter name" default answer "")) & ", 

" & thisReply

on processChoice(thisChoice)
	if thisChoice is "boilerplate 1" then
		set theText to "product no longer available"
	else if thisChoice is "boilerplate 2" then
		set theText to "product available in June"
	else if thisChoice is "boilerplate 3" then
		set theText to "please refer such-and-such a page"
	end if
	return theText
end processChoice

but i dont really understand how this works.
can anyone explain me how this script works, and how i can do a UI (on Xcode for example)?

Thank you,
Keytachi

ok, ive managed to change the menu script, but now i have a problem, the password is not being typed :S
here is the script:

property UN1 : missing value

if UN1 is missing value then
	display dialog "Please enter username" default answer ""
	set UN1 to text returned of result
end if

property UN2 : missing value

if UN2 is missing value then
	display dialog "Please enter username" default answer ""
	set UN2 to text returned of result
end if

set theUn to {UN1, UN2}
set theChoice to (choose from list theUn) as text
set thisReply to processChoice(theChoice)
property PW1 : missing value
on processChoice(thisChoice)
	
	if thisChoice is UN1 then
		
		if PW1 is missing value then
			display dialog "Please enter password" default answer ""
		end if
		set PW1 to text returned of result
	else
		set PW2 to text returned of result
	end if
	if thisChoice is UN1 then
		set CR to ASCII character of 13
		set TB to ASCII character of 9
		tell application "System Events"
			tell application "World of Warcraft" to activate
			keystroke UN1 & TB
			delay 10
			keystroke PW1 & CR
		end tell
	else
		set CR to ASCII character of 13
		set TB to ASCII character of 9
		tell application "System Events"
			tell application "World of Warcraft" to activate
			keystroke UN2 & TB
			delay 10
			keystroke PW2 & CR
		end tell
	end if
end processChoice

hope someone can help me