Trim can be handled by the system without a dedicated script, either as contunues trim (by just mounting it with the discard option) or periodically via already provided SystemD services and timers (both supported by btrfs). And I think the most common defaults would be doing it once a week or so.
Scrubbing on the other hand once a week feels excessive to me. And I would definitely not look at the result only at the moment I start the next scrub. Also I like having such stuff happen in the background without noticing much, so again SystemD is your friend by providing you ways to do it on a timer while also limiting the amount of ressources used via slices and ways to only notify you on a failure.
And then there is balancing which I really do very rarely. If you don't have the habit of littering your disk with dozens and dozens of snapshots until it's getting full, there is not much need.
(And then there're the SMART self-tests I would definitely not skip... a simple short one daily doesn't hurt, a more extended full one once a week.)
Long story short. Even if I wanted to do exactly what you plan, I would not put it into one script, because of different intervals (also to spread things out over time).
Edit: And to keep this whole thing more constructive, here my setup for scrubbing as an example
background.slice:
[Slice]
CPUQuote=20%
IOReadBandwithMax=10M
notification_mail@.sevice:
[Unit]
Description=Send Systemd Notification to eMail
[Service]
Type=oneshot
ExecStart=/sbin/sh -c 'echo "Subject: Service %i failed\n\nService %i failed.\n$(systemctl status %i)" | /sbin/msmtp <mail.address>'
[Install]
WantedBy=multi-user.target
monthly_scrub.service:
[Unit]
Description=Monthly BTRFS Scrub
OnFailure=notification_mail@%i.service
[Service]
Slice=background.slice
Type=simple
ExecStart=/sbin/btrfs scrub start -RBd / >> /var/log/monthly_scrub.log
monthly_scrub.timer;
[Unit]
Description=Monthly BTRFS scrub timer
[Timer]
OnCalendar=monthly
RandomizedDelaySec=1day
Persistent=true
[Install]
WantedBy=timers.target