How to keep scripts persistent during admin-ajax process when saving widget?

After deep meditation and a meeting with dally the llama (maybe it was an alpaca, I was quite high), I’ve defined a solution.

Use the widget-updated var to reload the JS function on widget save.

$(document).on('widget-updated', function(event, widget) {
    doAccordion();
});