Help Unmouting disk if UUID is mounted until a Specific Time
There is no shell script needed if you use two launch agents.

You need the UUID of your Time Machine backup drive:

diskutil info $VolumeName | grep "Disk / Partition UUID:"


Replace $VolumeName by the actual volume name of your TM drive. If the name contains spaces use double quotes (e.g. "Time Machine backup drive".

Create two files usr.tmvolume.unmount.plist and usr.tmvolume.mount.plist in ~/Library/LaunchAgents/:

nano ~/Library/LaunchAgents/usr.tmvolume.mount.plist


with the content

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;usr.tmvolume.mount&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/usr/sbin/diskutil&lt;/string&gt;
        &lt;string&gt;mount&lt;/string&gt;
        &lt;string&gt;$UUID&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;StartCalendarInterval&lt;/key&gt;
    &lt;array&gt;
        &lt;dict&gt;
            &lt;key&gt;Hour&lt;/key&gt;
            &lt;integer&gt;15&lt;/integer&gt;
            &lt;key&gt;Minute&lt;/key&gt;
            &lt;integer&gt;15&lt;/integer&gt;
        &lt;/dict&gt;
    &lt;/array&gt;
&lt;/dict&gt;
&lt;/plist&gt;


and

nano ~/Library/LaunchAgents/usr.tmvolume.unmount.plist


with the content:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;usr.tmvolume.unmount&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/usr/sbin/diskutil&lt;/string&gt;
        &lt;string&gt;unmount&lt;/string&gt;
        &lt;string&gt;$UUID&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;StartCalendarInterval&lt;/key&gt;
    &lt;array&gt;
        &lt;dict&gt;
            &lt;key&gt;Hour&lt;/key&gt;
            &lt;integer&gt;8&lt;/integer&gt;
            &lt;key&gt;Minute&lt;/key&gt;
            &lt;integer&gt;30&lt;/integer&gt;
        &lt;/dict&gt;
        &lt;dict&gt;
            &lt;key&gt;Hour&lt;/key&gt;
            &lt;integer&gt;15&lt;/integer&gt;
            &lt;key&gt;Minute&lt;/key&gt;
            &lt;integer&gt;45&lt;/integer&gt;
        &lt;/dict&gt;
    &lt;/array&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Replace $UUID in both plists by the UUID of your Time Machine volume found previously.

Load both plists with:

launchctl load ~/Library/LaunchAgents/usr.tmvolume.*


Now the TM backup  drive will be unmounted at 8:30am, mounted at 3:15pm and unmounted again at 3:45pm. Adjust the dates as needed.