There are many things you can do. It pretty much depends on which is the desired effect. In NT Resource Kit Support Tools (that can be downloaded for free) you can find a utility called logoff that you can use to schedule a logoff from the command prompt. I don't know if it is working with W98 but I think there are good chances to work with W2K. The problem is that this utility cannot check how long the session has been idle.
Depending on your requirements, you might use other tools (like "net user", "net session") to determine the lenght of the session and if it is iddle or not...