Use CODE tags when posting, it will preserve formatting and make your code much more easy to read.

It will also five you a clue where the EndIF's should be:
Code:
If InGroup("All Students")
USE H: /delete /persistent
USE H: @HOMESHR
If @ERROR
$=MessageBox("Cannot map home share, reason: ["+@ERROR+"] "+@SERROR, "Logon error",0+16+4096,30)
$=LogOff(1)
EndIf
EndIf