I'm not sure, but I think it's not possible.
Here's a function to set focus to different elements (no MIDI editor there)
Code:
C: void SetCursorContext(int mode, TrackEnvelope* env)
EEL: SetCursorContext(int mode, TrackEnvelope env)
Lua: reaper.SetCursorContext(integer mode, TrackEnvelope env)
Python: RPR_SetCursorContext(Int mode, TrackEnvelope env)
You must use this to change the focus programmatically. mode=0 to focus track panels, 1 to focus the arrange window, 2 to focus the arrange window and select env (or env==NULL to clear the current track/take envelope selection)