It's cute. Kind of surprising how much code it takes just to do one bare-bones window!
I'm very impressed by how you use long variable names to make your code self-documenting. That makes it very readable, despite some long scripts.
One problem: When I load it (Chrome, Mac) the window starts jumping around the screen all by itself, and the close and max/min buttons appear and disappear randomly. When I enable JS, it stops doing that and starts working. I read the one procedure in which you use JS, and I didn't see anything that should lead to that behavior.
Figuring out the exact width of a text is why the WRITE primitive moves the sprite to the end of the text. You subtract the starting position from the ending position.
The window starts the dance when minimized.
Without JS Enabled the "window label..." recursion does not stop.
Because the wIndow width appears to be rounded down, the label length check fails.
I noticed that it only flickers when I resize the window to have a width smaller than the title, and when I minimize it. Everything else works just fine. The same thing happens when javascript is enabled.