Unfortunately it’s known for Cubase’s Macros, they are just fired one by one. Cubase doesn’t know, if the previous action has been executed and also finished. Therefore some Macros don’t work as expected.
There is some kind of “idle” missing. Myself, I’m using File > Save function as kind of “idle”. It doesn’t break anything to save the project. But Cubase always wait (with the other action) until the project has been saved.
In this case, I would put the Save function behind Select in Loop function, to make sure, the selection is really dome properly. Then I would probably put it even after Open Key Editor, to make sure the Editor is open and Cubase will really Zoom in the Editor, not in the Project window.