次のことを試しましたが、スクリプトの実行時にフォーカスがあったプログラムにフォーカスが戻りません。
import win32com.client
import win32gui
current = win32gui.GetForegroundWindow()
shell = win32com.client.Dispatch("WScript.Shell")
shell.AppActivate('Console2')
shell.SendKeys('{UP}{ENTER}')
shell.AppActivate(str(current))