Your script should check that there is only one instance. Try something like this:
mkdir ~/.lock_script || exit
trap "rmdir ~/.lock_script" EXIT
# Do whatever the script does continuously, here....
trap command takes care of cleaning up on exit, so even if the script is killed or terminated, it will clean up. No process can catch (trap) the TERM signal (Signal 9) so if you
kill -9 the script, it will not clean up after itself.
mkdir is an atomic operation as far as the kernel is concerned. If the mkdir does not succeed (Eg if the directory already exists) then the command returns an error, which causes the second half of the command to run - eg exit.
You can read the command as "mkdir or else exit" - it is better explained here: http://initialprogramload.blogspot.com/2008/11/single-script-instance.html
I would also suggest that you should not use
while true in this way - try if at all possible to think of another way of doing whatever you want to do.