There are two ways to approach this: one very simple, and one quite complex.
The simple way is to use the IdleDetect ActiveX provided by Rockwell. Unfortunately, the knowledgebase appears to be down for me right at the moment so I can't point you to that option right now, but it's definitely the best option if you can get at it.
The other option is using VBA. There are three parts to this problem:
1. Trigger code regularly to check if a logout (i.e. login of default user) is required
2. Check how long the system has been idle for
3. Perform logout
The first part is required because VBA is different to a PLC in that where a PLC runs code cyclically (i.e. over and over repeatedly), a VBA sub only executes if something specifically triggers it. So, we need to find something that we can use to repeatedly trigger some code.
In the HMI tags, there are tags which relate to the system time. Obviously, the "seconds" tag will change every second, and the "minutes" tag will change every minute. If we can detect a change in one of these tags, we can use that even to trigger VBA code every second or every minute.
To achieve this, have a look at these two threads. Have a play with this code and see if you can get something to work - perhaps to begin with just try putting some text on your screen and making it change colour or position or caption when the code is triggered - that way you at least know you're capturing the event. Note that these links do not relate
directly to your problem - one of them relates to me trying to cause a pop-up to appear when a PLC tag changed. But the principle of what you're trying to achieve is the same - cause VBA code to execute when a tag changes, whether that's a PLC tag or a system tag.
http://www.plctalk.net/qanda/showthread.php?t=99558
http://www.plctalk.net/qanda/showthread.php?t=89416
Next, we have to check how long the system has been idle, and see if it exceeds out time limit. Microsoft have an example of how to do this here:
https://msdn.microsoft.com/en-us/vba/access-vba/articles/detect-user-idle-time-or-inactivity
...but I found this this example from Stack Exchange was much simpler, and I think that's how I ended up doing it:
https://stackoverflow.com/questions/25257484/get-idle-time-in-windows-7-64-bit-with-vba
Once you've got the two steps above working, you're pretty much home. Every time your system minute tag changes, trigger code to check the idle time. If it exceeds the maximum idle time for your auto logout, then run code to login a default user. The code to do that can be found in this thread, which Garry already linked you to:
http://www.plctalk.net/qanda/showthread.php?t=95067
One final thing: ALWAYS, ALWAYS, ALWAYS PUT ERROR HANDLING IN YOUR VBA CODE
See how you go with that - if you get stuck on any of the parts of it, post back with some more details and someone will pop up to help further.