If the "Improvement" (build) window is open, ESC only closes that window.
If the "Design Units" window (or other overlays) is open, ESC brings up the game options and you CANNOT leave the game options with another press of ESC.
ESC should JUST close the window if one is open. When none are open, it can bring up the game options. No problem there.