I had to edit that file at one point myself (not for SAP). So i just edited my script for your needs, but haven't tested.
Code:
Break ON
dim $path, $servicesFile, $newLine, $tempFile, $backUp
$newLine = "SapmsPRD 3601/tcp"
$path = "%windir%" + "\system32\drivers\etc\"
$servicesFile = $path + "services"
$tempFile = $path + "temp.txt"
$backUp = $servicesFile + ".bak"
if open(1, $servicesFile) = 0
if exist($tempFile)
del $tempFile
endif
if open(2, $tempFile, 5) = 0
$curLine = readline(1)
while $curLine <> "sapdp00 3200/tcp" and @error = 0
$ = writeline(2, $curLine + @crlf)
$curLine = readline(1)
loop
if $curLine = "sapdp00 3200/tcp"
$ = writeline(2, $newLine + @crlf)
endif
while @error = 0
$ = writeline(2, $curLine + @crlf)
$curLine = readline(1)
loop
$ = close(1)
$ = close(2)
copy $servicesFile $backUp
copy $tempFile $servicesFile
del $tempFile
else
$ = close(1)
endif
endif
exit