How to script a logout while screen is locked?
Can you get system events to do Shift-Option-Command-q ?? 
something like... (I don't know the exact syntax)

'tell application "System Events" to keystroke q with command down option down shift down'