Before going into too much detail I need to ask, @mz94, Michelle, is this still a problem for you?
I believe, based on the solutions suggested thus far, I have thought of a sufficient solution: rather than highlighting the edge or drawing something over the MIP window when the MIP window is focused, I would rather somehow mask or add a colored/shaded window over all the other windows.
Basically, the problem stems from the use of an ultrawide monitor and/or multiple screens, always keeping the MIP window open (so, as I'm editing media items, i can quickly glance at certain properties in the MIP window as needed), and my focus (what i'm actually looking at) being on the main edit window (or some other window) when the keyboard focus/frontmost window is actually the MIP window.
So rather than highlighting or drawing a box around (or otherwise visually modifying) a window that i'm not looking at when this problem typically occurs, and which may even be on a different screen when it is the frontmost window, it would make more sense to partially obfuscate other windows (e.g. draw a semi-transparent colored highlight over them) whenever the MIP window becomes focused/frontmost.
That way, no matter which other window I may be looking at and think is the focused window at the time I'm about to press any problematic keystrokes, i'll have a clear visual indication over/around that window, indicating that, in fact, it's the MIP window that's currently focused.
And in your original problem, do you need to always, always, always, capture/intercept the problematic keystrokes, or only when the Media Item Properties window first appears?
Initially, I was thinking I would need to capture them anytime the MIP window is focused. But with the solution i described above, i think i should be able to prevent myself from making mistakes and changing things in the MIP window when I think another window has keyboard focus.
the part where i got stuck thinking this was a complicated problem to solve is, sometimes, i actually do want various keystrokes to work when the MIP window is focused (i.e. when i've intentionally focused it to edit properties of selected media item(s)), but don't want them to do anything in it when it is unintentionally focused, which is hard to notice when it's on another screen, or far off to the side of what i'm actually looking at.
But by modifying the appearance of the rest of the screen/app windows (for any/all displays & open windows), it'd be practically impossible not to notice it anytime I unintentionally have the MIP window focused/frontmost.
and, now that i'm thinking about it, this would probably be a good thing for me to implement as a system-wide solution, since there have occasionally (or quite often, depending on how busy i am) been times where i accidentally typed some text into the wrong window, or triggered macros in the wrong app/window, because i couldn't easily notice that the app/window i thought i had focused at the time actually wasn't frontmost.
so, i think the ideal solution for me would be having a global macro that simply lightly shades all other windows, or all areas of all connected displays, except for the currently focused app's frontmost window.
So now, i just need to figure out the most efficient way to do this without stealing focus from the frontmost app/window.