you will need to post your code here for us to help more effectively

but if you have the dialog close you could have all those events in a #group and disable the group when the dialog closes
or you can have a line in each to check if the dialog exists and if so do the rest, not as efficient