Why do scripts beginning with an 'S' exist in /etc/rc.d/rc{0,6}.d? Will there be trouble if I change the 'S' to a 'K'?
Is the behavior of the system changed when it halts/reboots?
Yes, the traditional system V init style (what that is) makes symlinks that start with S, or K. those with S means "start", and they are run with the "start" parameter when that runlevel is entered. Those with K means "kill", those services are run with the "stop" parameter when that runlevel is entered. This makes the different run levels have different sets of services running. If you cange one from S to K the server won't be started, it will be stopped then. That may or may not be a problem depending on whether or not it was a critical service.
BTW, this method is being obsoleted by newer, dependency based startup systems in newer Linux distros.
The best answer I found to this on another website is that the K and the S are ignored on run levels 0 and 6 as the system will simply executed all of those scripts with the stop command in alpha-numeric order anyway... So S or K doesn't even matter.
I can prove this in a default install of Ubuntu where I have examples like the following:
K20restsrv K20zfs-mount K20zfs-share
S31umountnfs.sh S40umountfs S60umountroot S90halt
The K examples have stop commands within those scripts. The scripts also specify default run levels when the start and stop commands will run like it shows default start on run levels 2,3,4,5 and default stop on 0,1,6