Update pam_script_ses_open

Numerous improvements:

* Slight refactor and comments
* Don't use time periods
* More comments