The threshold while using the "Manual Threshold" option is set by you moving the slider. If it makes a guess at the threshold to start with, it's probably by running the graythresh() function.
When you export code, it will use the threshold that you have selected because it assumes you will want to use that fixed threshold for all the rest of your images.
If you want to change the 65 to something else, you can do that in your code.
If you want your user to interactively adjust the threshold, you might look at my interactive thresholding app: in my File Exchange