I know there is already a hotkey for the GUI and this one is a bit nick-picking, but to me this behavior seems not factorio native and inconsistent with other UI elements.
Just my 2 cents: Esc should close the GUI and keeping it 'pinned' would fit better as an option, i.e. following the principle of least surprise :)