TurnOffTimer is a Kommander script that will help you shut down / restart etc. the computer at a specified time later.
It also has an option to save current session, and a "force" option. This option helps if the regular logout / shutdown procedure via kdm makes the computer hang (for me it happens often since I use ATI's proprietary driver fglrx). If you specify the option "force action" the script will bypass the smserver (that it uses through dcop calls) and issue halt / reboot or /etc/init.d/kdm restart command. You will have to enter root password to continue.
If you want to cancel the postponed action, the script issues "killall sleep" command, so make sure you don't have another sleep process running.