GitHub Repository Up and Running

Thank you for so much good feedback. There have been people asking about a GitHub repository for the code to do the safe shutdown.
https://github.com/JuiceBoxZero/LowBatteryShutdown
There you go.
Full instructions are in README.md for how to get the software. Of course, you may modify it, based on your needs/skill level, but the posted instructions should get it running on your Raspberry Pi Zero.
Because this is a GitHub repository, you’ll need internet access on your Pi, so I recommend either doing this in one of the following ways: all on a full size Raspberry PI, using a USB WIFI dongle on a Pi Zero, or using a Pi Zero W that is connected to WIFI.