This is from Rockwell knowledge base:
The controller has to wait until all pending messages (including block transfers) and motions have completed before completing the mode change.
When the ControlLogix (CL) processor receives a command from the keyswitch or software to transition to program mode, it has to shut down all connections and motions. All MSG instructions (both messaging and BTs) must complete or timeout, and all I/O connections must close or timeout before the Run light turns off. Also, motion instructions that are in progress have to reach safe stopping points before they can stop. THIS IS BY DESIGN. Other outside communications, such as HMI or spreadsheet data requests via DDE, can cause slow transitions, too.