If the filename (without any path) of the running script ($NAME) begins with an "S" or a "K" then:
- chop off the first three characters of $NAME
- set $ISBOOT to equal 1
What that actually means is anyone's guess. You'd have to examine the script itself to find out what it does with those variables.
I'd guess that the "S" and "K" are significant because the script is probably an init.d script under /etc/rc?.d/ - these scripts use symlinked names starting with "S" to be run when the run-level is starting (e.g. bootup) and "K" for scripts to start when the run-level is ending (e.g. shutdown). S=Start, K=Kill.
It chops off the first three characters of the filename because the symlinks are typically named like "S05scriptname" and "K10scriptname", where the number indicates the order that the script is to be executed. so "S01foo" runs before "S99bar"
So, the point of all that is to get the name of the script without that sysv rc-script naming stuff.
Probably because it's a script that does different things depending on what name it is invoked with.
Again, you'd have to examine the script to find out what it does depending on its name and whether ISBOOT==1 or not.