A script could do this, but you can also accomplish the same thing without much more effort by inserting the cursor at the beginning of the word and using a keyboard shortcut, which by default is Shift + Cmd/Ctrl + -. That requires removing your hand from the mouse, but you can always edit the keyboard shortcut to something more convenient, such as Cmd/Ctrl + 3.
Go to Edit > Keyboard Shortcuts... . If you don't already have a custom set of keyboard shortcuts, create one, then in the new set go to Product Area: Type Menu and scroll until you find Insert Special Character: Hyphens and Dashes: Discretionary Hyphen. Click on the line and you'll see the current short cut. Type the new key combination in the New Shortcut field the same way you would type the shortcut. If it's already in use, you'll see text indicating "Currently Assigned to:" Clicking the Assign button will create the new shortcut. If it was already in use, it will be overwritten to the new shortcut.
... View more