You can use a plug with timer or even a smart plug that device itself turns on and off when battery level reaches certain levels.
My problem with repurposing an old Android device is the security issues. Firmware doesn't get updated anymore. An alternative OS like LineageOS or PostmarketOS takes care of most of the software issues, but not the firmware itself.
Another issue is that the battery is going to be years old, and on 'recent old' Android devices its much more difficult to remove the battery.