Well I've taken your code and used PostPrep to post it
which attempts to allow certain html coding to be displayed.

Notice that you have mis-matched quotes which is why the
syntax coloring is off on the post as well here.

I've added some comments and have changed some indenting.

Your HTMLInput UDF is rather large and I would really work
on that as an individual UDF and make sure it works as
expected in a self contained script until you know it is
working the way you want it.

Basically review your code and remove the mis-matched quotes
and remark or remove stuff that is not code you expect to
operate as part of the script.

;NAME AddStudentToXeroxPrinterGroup.kix 
;AUTHOR Jeremy Schubert
;PURPOSE Allows to add students to the Xerox printer group which will allow the students
;to print to that printer.

Break On
$System = CreateObject("Kixtart.System")

If Not $System
$nul= MessageBox("KiXforms Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf

HTMLInputBox("Please enter the user name of the student to be added to the Xerox Printer Group.", "Add Students To Xerox Printer Group","Names","SUBMIT","","","CANCEL","")

;How do I do the array here?
$usernames=names ;value of the box that shows in the HTMLInputBox function

For Each $username in $usernames
;Well I see a quote that does not belong here
" GroupAdd (CSSDSTU, GG047-XeroxPrinter, $username)
Next

While $Form.Visible
$nul = Execute($Form.DoEvents)
Loop
Exit 1

;You can't leave the description of the UDF here and have it run
;You need to use a semi-colon to remark it out


Function HTMLInputBox() - Displays an Input-Box via IE

; Function HTMLInputBox() - Displays an Input-box via IE
;
; Author: Steve O ; posted as UDF by NTDOC
; Posted in Beta forum - http://www.kixtart.org/ubbthreads/showthreaded.php?Cat=0&Number=77407
;
; ACTION: Displays an Input-box that allows a user to input a string. This box is HTML based and
; uses the Internet Explorer Application object.
;
; SYNTAX: HTMLInputBox("
HTML Message", OPTIONAL "Window Title","Default Value","Button Text","Text Color",
; "
Background Color", "Alt Button Text","Alt Button Return Value")
;
; Version: 1.0
;
; Date: Sep 27 2001
;
; Date Revised:
;
; Revision Reason:
;
; PARAMETERS:
; HTML Message: The message for the Input Box. ex: What is your favorite color?
; Note: This can accept any HTML code, so go to town! Also Note: the tag is enabled, so if you want to do
; custom HTML, put
as the first tag.
; Window Title: ( OPTIONAL ) The title of the HTML Input Box Window. If blank, defaults to "
Question...".
; Default Value: ( OPTIONAL ) The default value for the box which will show when the box appears.
; If blank, defaults to blank.
; Button Text: ( OPTIONAL ) The text on the main button. If blank, default is "
SUBMIT".
; Text Color: ( OPTIONAL ) The color of text on the input box. If blank, this defaults to black.
; Note: This can be overridden by including additional HTML tags in the HTML Message.
; Background Color: ( OPTIONAL ) The color of the background of the HTML form. Defaults to silver.
; Alt Button Text: ( OPTIONAL ) If this is specified, an alternate button will appear on the form and
; if clicked, the function will (by default) return "
-1". This is useful as a "HELP" button, or
; for many other purposes.
; Alt Button Return Value: ( OPTIONAL ) If the Alt button is needed, and -1 is a potential legitimate
; return value for the main submit button, you can specify an alternate return value for the alternate button.
;
; REMARKS:
; This has been tested by the author on Win 98 and Win 2k machines. It should require at least IE 4.0
; to function, however it does not check the IE version before executing.
;
; RETURNS:
; The string in the text box, or another value if the "
Alternate button" is pressed. The alternate value
; defaults to -1, but can be changed by specifying the "
Alt Button Return Value".
;
; Dependencies: IE, KiXtart 4.x
;
; EXAMPLE:
; HTMLInputBox("
What is your favorite color?","Color Quiz","Red","Submit Me!","Black","Yellow","I don't know!!!")
;
; Source:

Function HTMLInputBox($L_Prompt, OPTIONAL $L_Title,$L_DefaultValue,$L_ButtonText,$L_TextColor,$L_BGColor,$L_AltButtonText,$L_AltButtonReturnValue)
Dim $HTML, $AppIE, $SF
If $L_Title = ""
$L_Title = "Question..."
EndIf

If $L_ButtonText = ""
$L_ButtonText = "Submit"
EndIf

If $L_AltButtonReturnValue = ""
$L_AltButtonReturnValue = -1
EndIf

Select
Case $L_TextColor = "Black"
$L_TextColor = "000000"
Case $L_TextColor = "Silver"
$L_TextColor = "C0C0C0"
Case $L_TextColor = "Gray"
$L_TextColor = "808080"
Case $L_TextColor = "White"
$L_TextColor = "FFFFFF"
Case $L_TextColor = "Maroon"
$L_TextColor = "800000"
Case $L_TextColor = "Red"
$L_TextColor = "FF0000"
Case $L_TextColor = "Purple"
$L_TextColor = "800080"
Case $L_TextColor = "Fuchsia"
$L_TextColor = "FF00FF"
Case $L_TextColor = "Green"
$L_TextColor = "008000"
Case $L_TextColor = "Lime"
$L_TextColor = "00FF00"
Case $L_TextColor = "Olive"
$L_TextColor = "808000"
Case $L_TextColor = "Yellow"
$L_TextColor = "FFFF00"
Case $L_TextColor = "Navy"
$L_TextColor = "000080"
Case $L_TextColor = "Blue"
$L_TextColor = "0000FF"
Case $L_TextColor = "Teal"
$L_TextColor = "008080"
Case $L_TextColor = "Aqua"
$L_TextColor = "00FFFF"
Case $L_TextColor = ""
$L_TextColor = "000000"
EndSelect

Select
Case $L_BGColor = "Black"
$L_BGColor = "000000"
Case $L_BGColor = "Silver"
$L_BGColor = "C0C0C0"
Case $L_BGColor = "Gray"
$L_BGColor = "808080"
Case $L_BGColor = "White"
$L_BGColor = "FFFFFF"
Case $L_BGColor = "Maroon"
$L_BGColor = "800000"
Case $L_BGColor = "Red"
$L_BGColor = "FF0000"
Case $L_BGColor = "Purple"
$L_BGColor = "800080"
Case $L_BGColor = "Fuchsia"
$L_BGColor = "FF00FF"
Case $L_BGColor = "Green"
$L_BGColor = "008000"
Case $L_BGColor = "Lime"
$L_BGColor = "00FF00"
Case $L_BGColor = "Olive"
$L_BGColor = "808000"
Case $L_BGColor = "Yellow"
$L_BGColor = "FFFF00"
Case $L_BGColor = "Navy"
$L_BGColor = "000080"
Case $L_BGColor = "Blue"
$L_BGColor = "0000FF"
Case $L_BGColor = "Teal"
$L_BGColor = "008080"
Case $L_BGColor = "Aqua"
$L_BGColor = "00FFFF"
Case $L_BGColor = ""
$L_BGColor = "C0C0C0"
EndSelect

$HTML = '
<HTML>' +
'
<BODY TEXT=' + $L_TextColor + ' BGCOLOR=' +
$L_BGColor + '
>' +
'
<TITLE>' + $L_Title + '</TITLE><B>' +
$L_Prompt + '
</B>' +
'
<form name=CompTrends>' +
'
<BR>' +
'
<input id=Answer name=Answer class=tbox' +
'
value="' + $L_DefaultValue + '" Tabindex="1"> ' +
'
<input id=Submitted name=Submitted type=hidden value=0>' +
'
<input id=Submit name=Submit type=button value=" ' +
$L_ButtonText + ' "
' +
'
onclick="CompTrends.Submitted.value=1" Tabindex="2">'

If $L_AltButtonText <> ""
$HTML = $HTML + '
<input id=AltButton name=AltButton type=button value=" ' +
$L_AltButtonText + ' "
' +
'
onclick="CompTrends.Submitted.value=2" Tabindex="3">'
EndIf

$HTML = $HTML + '
</FORM>' +
'
</BODY></HTML>'

$AppIE = CreateObject("InternetExplorer.Application")

;Set IE Object Properties
$appIE.top = 30
$appIE.left = 30
$appIE.height = 350
$appIE.width = 500
$appIE.addressbar = 0
$appIE.menubar = 0
$appIE.toolbar = 0
$appIE.statusbar = 0
$appIE.resizeable = 0
$appIE.navigate("about:blank")
While $AppIE.busy <> 0 And @ERROR = 0 Loop

;Write the HTML code to the document
$AppIE.document.write($HTML)

While $AppIE.busy <> 0 And @ERROR = 0 Loop

;Make IE visible and set focus
$AppIE.visible = 1
$SF = SetFocus("about:blank - Microsoft Internet Explorer")
$AppIE.document.GetElementById("Answer").focus

Dim $L_LastBoxValue,$L_LastBoxValueCache
While $appIE.document.GetElementById("Submitted").value = 0
If $appIE.document.GetElementById("Submit").value = " " + $L_ButtonText + " "
If $appIE.document.GetElementById("Answer").value <> ""
$L_LastBoxValue = $appIE.document.GetElementById("Answer").value
If $L_LastBoxValue <> ""
$L_LastBoxValueCache = $L_LastBoxValue
EndIf
EndIf
EndIf
Loop

If $AppIE.document.GetElementById("Submitted").value = 2
$HTMLInputBox = $L_AltButtonReturnValue
Else
$HTMLInputBox = $L_LastBoxValueCache
EndIf

$AppIE.QUIT
$AppIE = ""
EndFunction

GroupAdd() - Ads a User/Group to a Group Global/Local

;You can'
t leave extraneous code in your script it will error out
Code:
--------------------------------------------------------------------------------

;NAME GroupAdd
;
;AUTHOR ???
;
;ACTION Add's a object (user or group) to a group (global or local)
;
;SYNTAX GroupAdd(Target, Group, Object To add)
;
;PARAMETERS Target
; The Domain name or Workstation To work with. For faster workstation
; execution, include the Domain Name that the workstation is a meber of.
;
; "Kixtart/beanbag" would be working with the workstation Beanbag In the
; Kixtart domain
;
; Group
; The Group you want To add To
;
; Object To add
; This can be a local group or a userid, depending on what type of group
; the Group variable is. Always try To give the full name of the object.
;
;
;RETURNS @ERROR code
;
;REMARKS ADSI com object must be installed.
;
;EXAMPLES ;this adds the domain user "testuser" To the Global group "Domain Admins"
; $nul = groupadd("kixtart","Domain admins","testuser")
;
; ;this adds the user "testuser" In the domain "kixtart" To the local administrators
; ;group on the workstation beanbag
; $nul = Groupadd("kixtart/beanbag", "administrators", "kixtart\testuser")
Function GroupAdd($Target, $Group, $ObjToAdd)
Dim $target, $group, $OBJToAdd, $obj, $objhome

If SubStr($target,1,2) = '\\'
$target = SubStr($target,3,Len($target))
EndIf
If InStr($objtoadd,'\') <> 0
$objtoadd = Split($objtoadd,'\')
If UBound($objtoadd) <> 1 Exit 13 EndIf
$objhome = $objtoadd[0]
$obj = $objtoadd[1]
Else
$objhome = $target
$obj = $objtoadd
EndIf

$group = GetObject('WinNT://' + $target + '/' + $group)
If VarType($group) = 9 And @ERROR = 0
$group.Add ('WinNT://'+$objhome+'/'+$obj)
Else
$GroupAdd = @ERROR
Exit @ERROR
EndIf
$GroupAdd = @ERROR
Exit @ERROR
EndFunction