Two things:
1. If you want your script to execute code when it is first run, put that code at the top of your script, in the auto-execute section, instead of (or in addition to) a hotkey. Alternatively, you can have the script use the
Gosub command at the top of the script, to call a labeled subroutine. That fixes your issue about triggering the hotkey. The script can execute the code instantly when the script is run.
2. If the 2 is not sent, do some troubleshooting: what window is actually active,
according to the script? Does the Send line ever execute? If so, how do you know? What is the actual
ErrorLevel value before that (in the conditional statement)? You can add lines to the script to answer these questions. Use the script itself to help you understand what is happening, or use some of the AHK debugging tools.
PS, since you have decided not to use a timeout with WinWait, what purpose does checking the ErrorLevel serve? What are its possible values?
In some cases, a window can exist before it is ready to receive user input. A sleep before sending keys is usually the fix in those situations.