Script for Making new Account

Hey I was trying to make a script to make a new IMAP account in Mail. This is what i have so far but it doesn’t seem to be working.

set full_name to the text returned of (display dialog "Please enter your full name" default answer "Example: John Doe")
set user_name to the text returned of (display dialog "Please enter your Webmail Address:" default answer "Example: jdoe@abc.com")
set pass to the text returned of (display dialog "Please enter your password" default answer "")

tell application "Mail"
	make new imap account with properties {name:"SnailMail", user name:user_name, server name:"mail.server.com"}
end tell

Thanks.