I would suggest you try turning off spell check. Under the sublime text menu item go to preferences and click on "Settings Syntax specific". You get a file that shows setting for spell checking. If that is true, try to change it to false.
I discovered the issue to be the Spotify app. Just add this to the stack of grievances with their app/service and lack of support.
I still have Chrome open now, and about 30 seconds after quitting Spotify, F4 is working just fine again.
I just went a step further and found a solution! I diffed the running processes listed in Activity Monitor both before and ...
When a new keyboard is connected, macOS will show the Change Keyboard Type button in System Preferences > Keyboard. This is used to detect the type of keyboard. For mine, it would have had to be ISO, but it seemingly got wrongly configured in the past, and the button would not show.
Deleting /Library/Preferences/com.apple.keyboardtype.plist and rebooting ...
You can't achieve the first, as you'd have to have one instance for each word in which it occurs. As you've discovered, the text replacer needs a space before & after.
The second idea could be done using Ukelele & designing your own replacement keyboard layout. It's not an app I'm terribly experienced with, but I have managed to make my own modified ...
Xmodmap only works for X11 applications, the ones you've listed for sure are not X11 applications. Most likely you don't use any X11 at all.
To remap keys on macOS see the answer on Karabiner quit working in Sierra. How do I map my menu/application key to be Command? instead.
Another app commonly used to remap MacOS keys is Ukelele.
Solution with Karabiner
Add this to the directory ~/.config/karabiner/assets/complex_modifications as a .json file with whatever unique filename you would like.
"title": "Microsoft Outlook rules",
"description": "Microsoft Outlook Unmap command-A",