@Big D,
I'm not slamming what you have provided here but I'm wondering if it wouldn't be easier to get a program that changes the x button action (like Magic Button, which is free, however, I'm not sure if it works on WM6). Most of these programs also allow you to map the hardware ok/close button so that it works the same as a screen tap.
Just curious.