From my test of your script, I believe this behavior is both normal and documented. Here are the rules that apply in this case:
1) The auto-execute section does not end until the first return, exit, or hotkey label is encountered.
2) The default for SetFormat (and many other settings) is put into effect after 100ms if the auto-execute section takes longer than that to execute (which this one does since it falls right into the ChooseDigits subroutine).
3) In this case, because your auto-execute section takes a long time to finish due to the dialog, the chosen default is put into effect when the first return is encountered.
4) Newly launched threads from a hotkey or custom menu item always start out fresh with the defaults as set in the auto-execute section (in this case, the standard default of 0.6 is the global default until the user choses a new one in the InputBox).
It is usually best to have the auto-execute section set the required defaults right at the very top. Then, those defaults will always be in effect for every newly launched thread, whether it be launched by hotkey, menu, or SetTimer.
The other big thing to keep in mind is that changes made to settings such as SetFormat and KeyDelay by one thread will not affect the others. This is done so that you don't have to continually worry about "putting back" the right default value prior to returning from a hotkey or menu subroutine that may have temporarily altered it for its own purposes.
This is discussed in the Scripts section at
http://www.autohotkey.com/docs/Scripts.htm -- which I've updated to mention menus and SetFormat. If you find any other omissions or anything that needs clarification, let me know.
Thanks,
Chris