Look up 'multitag' in the SilkTest help. It's got some really good examples. For your case, it states when more than one instance of the window might be displayed at one time...
Use the instance syntax, which takes the form tag-string[n], where [n] refers to the instance.  refers to the instance of the window that is closest to the top on the desktop,  refers to the instance that is next highest to the top, and so on.
For example, you could have one declaration for the window whose tag is "My Window" and another declaration whose tag is "My Window". With these declarations, you can record and play back tests against two instances of the same window. Note that when an instance of the window becomes active, it automatically becomes MyWindow.
So for your example, I'd create a declaration of the window with the tag something like '[DialogBox]$MessageBox' and loop through closing it while it still exists.
Usually this error can be resolved by the following:
1.Go to "options/agent/verification and uncheck the "verify that a tag uniquely identifies a window" check box.
2.Add the following line at the start of your script: Agent.SetOption (OPT_VERIFY_UNIQUE, FALSE)
The second method is effectively the same as the first except that it can be turned on/off at runtime.
or try declaring the window as e.g.:
<font class="small">Code:</font><hr /><pre>[-] window MessageBoxClass MessageBox
[ ] tag "~ActiveApp/[DialogBox]$MessageBox"
[-] PushButton OK
[ ] tag "OK"
[-] PushButton Cancel
[ ] tag "Cancel"
[-] PushButton Yes
[ ] tag "Yes"
[-] PushButton No
[ ] tag "No"
[-] StaticText Message
[ ] motif tag "#2"
[ ] tag "#1"</pre><hr />