Don't overrate illegial orders. Most officers will never see one.
I would state that a JO thinking "outside the box" in most fast paced operational tempos would be quickly summoned to the CO's stateroom. The daily DH meeting or weekly training meeting, perhaps, but during an unrep or during flight ops, the JOs job is , safety issues aside, to follow established procedures and obey orders. Perhaps, the next day during the hot washup, a criticism might be appropriate, but not during the operation itself. During shipboard flight ops, often all the senior officers might be out flying and the young LTjg SDO might find himself in charge, standing in front of the ship's CO. My policy was to tell the SDO to develop a plan with which he was comfortable and go with it, every one else was to follow along. I firmly believe that there is one absolutely perfect response, one entirely wrong, and 98 in between which have varying degrees of correctness, some moreso than others but all doable. Pick a plan and go with it. Critique it the next day. In this situation, "thinking outside the box" is synonomous with "second guessing". Nothing will bring an exercise to an embarassing standstill quicker.
There is an old adage, "Order, counter order, disorder" by which the Marines live. We could all probably do well to also learn from it.
Mids I have talked to over the past few years have all stated that the memorization of the Laws is still required. Maybe some have not grasped the correlation between commiting them to memory and living by them, as you have outlined in your first paragraph.