I have a long-ish script to do some data analysis, and it has to connect to several databases. One of the databases tends to update my password more frequently than I like,
You can use the tkwait.window or tkwait.variable functions. Use the above code to pop-up the window, then use one of the wait functions (tkwait.window will stop the script from proceeding until the window is destroyed, essentially when you click on OK). Then when the script proceeds you will have your value in the variable within the script/function and can just use it there without needing to assign a global variable.