My final question is, without creating 2 copies of the script with different file names, can Kix detect when the user logs off or on?

I know you can name one copy login.kix and the other logoff.kix and insert the action by parsing the filename, but I am looking for a action perspective.