Suggestion: Toggle focus between dialog and parent window

I'd like to have an option to toggle the focus between a script dialog and it's parent window like dlg.focus = True/False.