I've been meaning to make something like this for quite some time, and your question gave me the impetus.
Here's an indicator based on the above code. Hours can be set in the code, or by the indicator settings window.
I tried to make one that would use a separate window, but I forgot that comments only work on the main charts.
If people are interested in that, I can make one that uses objects, rather than comments.
Enjoy!
-Cubesteak