Since you are requesting a chart study I moved your question out of the "Frequently Asked Questions" topic and into the "Chart Studies" topic. I also updated the title of your question so that it more clearly describes the solution you have requested. This will make it easier for other viewers to locate this solution using the search function.
I see we have already published solutions for opening range breakouts but those were requested for custom scans and not the actual chart study.
The following solution plots the lines as you described and also includes user inputs to adjust the start and end time of the opening range:
input openingRangeStartTime = 930;
input openingRagneEndTime = 935;
def openingRangeSpan = SecondsFromTime(openingRangeStartTime) >= 0 and SecondsTillTime(openingRagneEndTime) > 0;
def openingRangeBegin = !openingRangeSpan[1] and openingRangeSpan;
def openingRangeHigh = if openingRangeBegin then high else if openingRangeSpan and high > openingRangeHigh[1] then high else openingRangeHigh[1];
def openingRangeLow = if openingRangeBegin then low else if openingRangeSpan and low > 0 and low < openingRangeLow[1] then low else openingRangeLow[1];
plot orHigh = openingRangeHigh;
orHigh.SetDefaultColor(Color.DARK_GREEN);
orHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
plot orLow = openingRangeLow;
orLow.SetDefaultColor(Color.DARK_RED);
orLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);