I've tested this script several times and it will always work as designed. I suspect that there is something else going on that isn't shown in your code;
1) The variable "ok" isn't declared and it can cause problems.
2) You are using global variables and that is simply bad design. I'm not going into big details about global variables but do google it and You will find out why.
3) I would replace the "4+32" with the constants defined in LSCONST.LSS; Replace "4+32" with MB_YESNO + MB_ICONQUESTION and the "6" with IDYES and "7" with IDNO and then also change the logic of the if-statements;
4) I try to avoid using the "NOT" statement - it makes code harder to read and understand. Always test for the result that You are expecting and that will trigger the if statement - not the opposite:
If ok = IDNO Then ...
is far more readable and understandable than
If Not ok = IDYES Then...
hth