For each Vim mode the <SID><\O> key sequence is mapped in order to appropriately escape (e.g. <C-\><C-O>) from Vim's current mode (e.g. insert-mode) to its normal mode. The right hand side of each mapping ends in its left hand side (e.g. <SID><\O>) in order to recursively try to escape again. The script-local (<script>, <SID>) recursion stops as soon the last escape key sequence reaches Vim's normal mode in which the <SID><\O> key sequence is mapped to nothing (<Nop>).

Likewise the <SID><\N> key sequence is mapped to not only escape once (<SID><\O>) from e.g. insert-mode before returning back but permanently stay in normal-mode.

With the help of the above definitions I mapped the <F1> and <S-F1> function keys as follows:

Instead of having the <F1> key simply open Vim's help in a new window, it starts the :help command with the inner word (<cword>) under the cursor. By consecutively pressing the <F1> key, one switches to the outer word (<cWORD>) and toggels back again.

The 4 mappings from the use case above could also be defined as follows in order to not repeat yourself; i.e. keeping it "dry":