You can already assign hotkeys to toggle between live-preview and source modes, as well as assign a hotkey to toggle reading mode on and off. What you want?
The recommended approach to automate writing to notes is the new action URI.
The name may mislead you,
but you can also use that to append to an or overwrite an existing file.
Without having to use any keyboard automation.