You need to understand how the program is supposed to work with this static 'wasVisible' field to be able to diagnose what's wrong with ZwCad.
When a document is about to be closed (DocumentToBeDestroyed) the program stores the current value of the Visible property in the 'wasVisible' field, and if this document is the only one open, the Visible property is set to false to hide the palette.
When a new document is opened (DocumentCreated), the program sets the Visible property to the value stored in the 'wasVisible' field.
So, if the palette is visible when you close the last opened document, 'wasVisible' is set to true and the Palette hides (No document state). When you open a document, the Visible property should be se to true (the value stored in 'wasVisible').
Knowing this, you should be able to diagnose what's wrong with ZwCad.