1. AZ Controller can do event/time based activity in "Monitor"s. There is "Context" state set, which has "NoProject" state. You can organize state monitoring for it and update some defined by you state set, f.e. "Project" with states "Not Loaded"/"Loaded". Then using conditions update that set so it match the reality. Finally, you can monitor "Project" set and send something.
For initial handshake, you can use timer based monitor conditioned with "Initialized" ("Yes"/"No") set, so it send something let say once per second till it gets expected response. For an example check build-in "Mack. Control" preset.
2. As Bassman has mentioned, Cakewalk sends some resets to all MIDI ports. You can set "Block all channel messages" + "Block all SysEx" in AZ Controller Options to prevent that for particular port (if you don't want disable these messages globally, f.e. you use some hardware MIDI synth). But something still can leak in case AZ Controller / Preset are not leaded yet at the time Cakewalk sends these messages (should not happened in practice...).