Help With setTimout function

I am trying to solve a business problem. I had a script that ran 24/7 from a code page in Quickbase which would allow a screen to continually refresh every minute. I only need the scrip to run during a certain time of day and only on certain days. Here is the code I’ve been piecing together through online feedback, but it is not working. I would like to learn JavaScript, but for now I’m a total newbie and would just like some help making this script work. Thank you, in advance, and here is the script:

var now = new Date();

//Example of changing the TZ (EST)
const now = new Date(now.toLocaleString(‘en-US’, { timeZone: “America/Louisville” }))
const hour = now.getHours();
const day = now.getDay();