Whether inserting text by typing or pasting, is not necessarily an issue. Just try to switch the corresponding action to “insert by pasting” instead of “insert by typing” and see if it still works.
The main difference between Peter’s original macro and my follow-up variant is that my variant also lets you select a previous (recent) frontmost Finder window. But you don’t have to; if you just hit Return you’ll get the currently frontmost window just as fine.
On the other hand, I’m not sure if my macro still works with the current KM8. That’s why I recommended to use Peter’s original macro, which is way more simpler and robust.
I will test it tomorrow.
PS:
Personally I don’t use any of the two macros, because I’m perfectly fine with Default Folder X’s ⌘-Click on a window
PS #2:
To answer your other question:
On a related note - it it possible to create a macro group that is only active when a file open/save dialog is open?
I don’t think so. But you could create a condition (via an action) that checks if for example an “Open” or “Save” button is present. But, depending on the trigger, this could be pretty resource-intensive (since it has to respond always), so I wouldn’t do it.
Unless somebody has a better idea on that.