How Can I Create an AppleScript to Send a Message When I’ve Received a New Text Messag

I want to create an Out of Office script to respond to new text messages after hours. Here’s the logic:

If
     The current day is Mon, Tue, Wed, Thu, or Fri AND
     The current time is between 5:00 pm CT and 9:00 am CT AND 
     The sender is not on my Contacts "VIPs" list
Then
     Send the message
Else
     Don't send the message
End If

I can’t seem to find the correct message handler. Does anyone know how to do this?

By the way, I’ve already tryed modifying the Driving Focus Mode to achieve this, but it doesn’t always work.