Where would be the places to set application and session attributes in moqui so that they are available for all transition, service and script code to use?
In this instance, where would I initialize an AwsS3Client so that it could be reused?
Most APIs have factory methods for getting singleton objects, or are designed so that objects are created for each use. In those cases you don't need any lifecycle (init/destroy) management.
If you do need that the easiest place to call a script on startup and shutdown is in the Moqui Conf XML file with the after-startup and before-shutdown elements under the webapp-list.webapp element.
Moqui runs in a standard Java Servlet container, so you can also add things to the web.xml file (either before the WAR file is built, or unpackage the WAR file, change the web.xml file, and zip it up again).
Java has more hack-ish approaches like using a class with static initialization, but it isn't as clean as real init/destroy code.
Still, I'd look into the API to see how it is designed to be used. It may be best to use its singleton factory or init an object with each use. Usually it is things more like transaction managers and databases and such that run as services and need real lifecycle management.