You might want to iterate like this,

Code:
#!/bin/bash
for i in 5 4 3 2 1;do sleep 1; echo "sleep $i"; done
echo "you have now waited 6 seconds... Yippie!!"

# insert commands here :)
exit
But the question remains... if you just wait for 6 secs, does clicking on the desktop icon that appears work? If not, I should find out why... could be the udev device management (which is cool and IBM supported so I don't mind looking into it ) and KDE.