Hi question,
If you really want your script to "go to sleep" while you load another data set, then "wake up" the script and have it continue from where it left off, then I'd recommend the InteractionON() function from Walter's list.
If you want the script to start anew from its first line after loading another data set, then you should make an easy way to restart the script, such as an <F1> button or a new custom icon or a custom menu.
Brad Turpin
DIAdem Product Support Engineer
National Instruments