How bout this idea ...

1. Create a table that shud contain username and last_logon_time .
2. Write a trigger on logon event that will make entry into this table
by select username,logon_time from v$session;

3. Based on specific date range say if sysdate - last_logon_time > 20
alter user account lock.