Are you sure there's no errors in the console window?
configureChart was silently failing with your exact script because I didn't have a data key named average. Once I changed those lines, it worked:

def configureChart(data, chart):
from org.jfree.chart.plot import ValueMarker
marker = ValueMarker(4) #point on range axis to label
label = 'Avg:'
marker.setLabel(label)
chart.getPlot().addRangeMarker(marker)
marker1 = ValueMarker(8) #point on range axis to label
label = 'Avg:'
marker1.setLabel(label)
chart.getPlot().addRangeMarker(marker1)