A minimal wrapper script could look like this:
echo > /proc/swsusp/activate
dcop --all-users --all-sessions kdesktop KScreensaverIface lock
This activates hibernate and locks alls KDE sessions on resume. You can place it somewhere in /usr/local/bin for example and assign a keyboard shortcut for it. Many laptops have sleep keys, acpid
usually is able to process them. Just map the sleep event to your script.
However, I'd strongly recommend to use the hibernate script from suspend2.net instead of a homebrewed script like above. Furthermore make sure to backup your data before calling hibernate from within KDE, it's still rather experimental.