P.S.: Restrict logon hours on entirely domain in Active Directory is not an valid option.
There is no such time based schedule option available in horizon view however you should consider using native AD to control Logon Hours and apply the GPO to the OU within which the Pools computer objects are created.
You can even force disconnect the users if their connection is active ( Global Settings for Client Sessions ) and you want them to immediately disconnect outside of the hours for which the desktops should be accessible.
Other than that in WS1, you can create 'time schedules' and 'Profile restriction config' together to achieve this. Please check:
Other method include disabling the pool using script as you are already doing: