Intercept many hotkeys and conditionally insert an action before them

This is outside the scope of this forum, but …

My understanding is that you never want certain keystrokes to trigger changes to media item properties. If so, why don't you just change or delete the keyboard shortcuts for the relevant commands in Reaper?

(For those who don't know Reaper, it's extremely customizable. If I were faced with a problem like this, I would attempt to fix it within Reaper before attempting anything complicated in KM.)