Is there a program/tool that can use to deal with boilerplate such as indicating who is speaking in my text on the go with hotkeys? What I'm imagining is, for example, when writing a back-and-forth dialogue I can just select a text segment and press a preconfigured key dedicated to a character and the line gets "assigned" to that character in some way. This can be highlighting the text a specific color, or a literal auto rearranging of the text so it looks like {CharacterName}: "text". That way I don't have to spend a bunch of time constantly typing up character names or punctuation and keep the flow of my writing.
This becomes an issue at times when I get in the flow of things, end up with a couple thousand words of text and then have to untangle who said what for a while.
I mostly use Scrivener but I'm also open for using other tools/word processors.