Just a friendly note because this is the second time (at least) that I've run into this problem and it is very frustrating and unintuitive to resolve.
Well, then we noticed that our Overview Pages would fail to load the Layout/Widget Panel when editing and instead would just get stuck on the 'Loading' spinner graphic.
I narrowed it down to only when a document which contained the macro I just modified was being loaded in a View Document widget. Not just that, but only when MULTIPLE of these macros were in that document.
Very curious I thought.
So after flailing around for a while, having a good yell at the computer, it finally dawned on me that I had seen this happen before with another macro that I also "simplified" a year or so ago.
What I recalled then, was that it was a problem with how the widgets are loaded "safely" when in Overview Page edit mode. What this does is extract all the scripts and then load them dynamically or something weird. The problem is that if it hits the same script src url twice, it chokes and fails silently. What a nice "safe" feature.
Problem is that the Widget Panel is waiting on that safelyLoad call to return before removing the loading placeholder.
Anyway, hope this helps you not struggle for a couple hours like I did (multiple times). And hopefully, it will help me not do the same next time.