probably a noob question - but i'm a bit of a DBC noob

I have been reading through TDKs tuturials and using help in DB to try out some features.
I have a menu screen that loads, user clicks New game button , and the player goes to level 1, and can progress to level 2 when certain conditions are met. This all now works fine. I was wanting to save current position etc to file to load game (from the menu) at a later date.
The problem comes when the "q" button is pressed, the main menu should be displayed on screen until the user mouse clicks, but the menu only gets displayed very briefly then the program hangs.....
I know it sounds like a sycn and or loop issue, but i've tried different fixes with no success. I should also say that this project has evolved and is very much a work in progress, so the design was non existent!
I have attached the full source code (i think), as I'm not sure what may or may not be important.
any help gratefully received!
Sorry for the length of the post!