in reply to Optimise the script

if i understood it correctly, you want lines matching specific time interval.