As far as I see after you press 'ok' on the form you will get on the console:
insiide ok iinside ok after Alert is displayed
Then you will see the alert and every time you press 'ok' on the alert you will see the same two lines and the alert will stay on-screen. This is because you do not take a different action based on which display you are in.
I ran it in WTK 2.1 - when I press 'ok' in the form I get the two lines printed twice. Then each time I press ok in the alert the two lines get printed once. Next I changed the code in commandAction as I wrote it in my previous post and what happens when I press 'ok' in the form is that it goes to the alert (I see 'iinside ok after Alert is displayed') and then it immediately shows the form again. It looks like if you use the same Command in the form and the alert it gets 'clicked' automatically after you change the display.
Probably you should use different instances of Command.