stop(true); will end the script and logout and not log you back in.
So you could add a timer and if timer > timeAlloted, stop(true);
Besides this, to actually stop the autologin, youd need to launch in CLI with -norandoms and use a custom login hander.