Sure, that is really the reason for scripting. They are called cron jobs, because they run on a schedule. Its a command called crontab. Unix is all about doing things automatically. Takes a bit of time to set up, but then it does what you want, when you want it. Your going to love it once you use it. Edit: spelling
I’d try raising the temp on the heat bed and maybe on the extrusion for the first layer.
The bed arcs up in the middle when it heats, so it may also be an issue with z offset. If it is 0.35 in the middle, but 0.45 at the edge, you might just need to smoosh the first layer more. Speed also effects first layer, so slowing down sometimes helps.
Find a big flat one layer test print and see what helps. Just don’t doal bunch of changes at once.