The new hotkey system in 20.5 does indeed give state hotkey contexts priority during hotkey resolution. However, to take advantage of that, you need to use the hotkey system, i.e., register a hotkey context symbol, hotkey action symbols, and default key bindings for that hotkey context. Without that you're at the mercy of the hard-coded order in which various key event handlers are triggered by Houdini. It also good practice to do in general so that key bindings can be customized through the hotkey manager.
I think the examples/documentation are still a little behind in this respect, so the easiest way to see an example is to look at one of the python states we're shipping. For example, $HFS/houdini/viewer_states/
sidefx_clip.py. The way it's done there is designed to work under both the old and new hotkey systems in 20.0 and up, though of course the new system is only used by 20.5 and up.
What you're looking for is the use of the `hou.PluginHotkeyDefinitions` object to register the various hotkey symbols and default bindings with the viewer state template in `createViewerStateTemplate()`.
In the `onKeyEvent()` function, you'll want to note how `viewerstate.utils.hotkeySymbolOrKeyString()` is used instead of the raw key string from the `ui_event`, and compared against a hotkey symbol using `hou.hotkeys.isKeyMatch()`.