Try this (you had a endfunction lying around... )
Code:

$Computer = 'servxp1' ;ReadFile('\\curricsvr1\netlogon\scripts\computers.txt')
$Service = 'rexesvr'


$objService = Getobject("WinNT://$Computer/$Service,Service")
if @error = 0
$status = $objService.status
select
case $status = 4 ;Running
; do something

Run "Beyondexecv2 \\" + $Computer + " -d LockWorkstation -l 0"

case $status = 1 ;Stopped
; do something

fADSIServiceRun ($Computer, $Service, 1)

case $status = 7 ;Paused
; do something

fADSIServiceRun ($Computer, $Service, 1)

case 1
? "Unhandled service status(0):$status"
exit (1)
endselect
else
? $Computer
? "Error: " + @error
? " " + @serror
endif



Function fADSIServiceRun ($Computer, $Service, $Run)
Dim $objService, $status, $StartUp
; Validate input parameters
if VarType($Computer) <> 8
exit(87)
endif
if VarType($Service) <> 8
exit(87)
endif
if VarType($Run) <> 2 and
VarType($Run) <> 3 and
$Run >= 0 and $Run <= 3
exit(87)
endif

if $Computer = ""
$Computer = @wksta
endif

$objService = Getobject("WinNT://$Computer/$Service,Service")
if @error = 0
$status = $objService.status

select
case $Run = 0
select
case $status = 4 ;Running
$objService.stop
case $status = 1 ;Stopped
exit (2182)
case $status = 7 ;Paused
$objService.stop
case 1
? "Unhandled service status(0):$status"
exit (1)
endselect
case $Run = 1
select
case $status = 1 ;Not Running
$StartUp = $objService.get("StartType")
if $StartUp <> 4
$objService.start
else
exit (1058)
endif
case $status = 7 ;Paused
$objService.continue
case $status = 4 ;Running
exit (3521)
case 1
? "Unhandled service status(1):$status"
exit (1)
endselect
case $Run = 2
select
case $status = 4 ;Running
$objService.pause
case $status = 1 ;Stopped
$StartUp = $objService.get("StartType")
if $StartUp <> 4
$objService.start
$objService.pause
else
exit (1058)
endif
case 1
? "Unhandled service status(2):$status"
exit (1)
endselect
endselect
$objService = ""
else
? $Computer
? "Error: " + @error
? " " + @serror

endif
EndFunction

Function ReadFile($file)
Dim $lf, $f, $_, $t
$lf=CHR(10)
$f=FreeFileHandle
$_=Open($f,$file)
If @ERROR Exit @ERROR EndIf
Do $t=$t+$lf+ReadLine($f) Until @ERROR
$_=Close($f)
$ReadFile=Split(SubStr($t,2),$lf)
EndFunction


And just a sidenote - It's much easier to read something when you call a function first, and then have the functions (last or in different file)
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!