In your case there is no need to check if the Window is opened or not, instead may directly call the close() method
of the widget. The widget will check internally if it is currently opened or not and will handle the action accordingly. You should to check only if the widget is initialized. Please see the code sample below.
wnd = $(
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI