Here's my solution, which only restores focus to the command window. Restoring focus to the command window is easy, the tricky part is knowing whether or not the focus belongs there.
%Step 1 - get focus status
cw = com.mathworks.mde.desk.MLDesktop.getInstance.getClient('Command Window');
cw_has_focus = cw.hasFocus;
%Step 2 - launch process with focus stealer
%Step 3
if cw_has_focus
commandwindow
end