In case you won't have a script to do what you want, you could do it without a script, using Markers:
You could put Comp Markers at places in time where each scene begins,
and then use a simple expression to change the string of a text layer to display the index number of that marker, which will be the number of the scene.
p.s.: In order to place the markers faster, you could use the SHIFT key in order to scrub the timeline and snap to beninng of scenes, and then use the "*" key on the numeric keypad to add a comp marker (make sure you don't have any layer selected when you click the * key, otherwise you will add a layer marker instead of a comp marker).
p.s.: If you need help with the expression changing the text, let me know.