Hi Dan,
One of the easiest ways to ensure Mango restarts on crash is to touch /path/to/mango/RESTART which will cause the ma-start.sh or ma-start.bat script to start Mango again when the currently running Mango finishes. Scripts in Mango/bin/ext-enabled are called with the first argument 'restart'
To your question, yes it is possible to schedule a restart from within a Mango script, but there aren't any wrapper hooks, so you have to do it the same way the modules page would,
com.serotonin.m2m2.web.dwr.ModulesDwr.scheduleRestart(); //Schedule restart for ten seconds from now.
or you can get whatever delay you want,
var timeout = com.serotonin.m2m2.Common.getMillis(com.serotonin.m2m2.Common.TimePeriods.MINUTES, 17);
var lifecycle = com.serotonin.provider.Providers.get(com.serotonin.m2m2.IMangoLifecycle.class);
lifecycle.scheduleShutdown( timeout, true /* restart */, null);