Nortelshop,
I am not aware of a way for a script to logoff an agent. You are able to go into the switch manually and disable and re-enable a TN which forces a logoff of the agent.
There are 2 types of ways of presenting a call to the agent. One is ringing the phone and allowing the agent to answer by pressing in-calls. If you are using this type of call presentation, you can define the RTQ feature (return to queue) after so many rings and make the phone go into "make busy" which would in turn log out the agent. If you are using call force to present the call, this option is not available.
If you are concerned about calls being presented after closing just use a time of day check in the script. If you are worried about compliance and adherence being skewed, I have our workforce trained to look at the agent real time display and make sure everyone is logged out when we close.