It might be related to the not getting an InSim signal for the green light - IIRC that was to thwart people who would make an InSim launch control from it.
It's not ideal, but you can calculate the time the race/lap started when the first car hits S1 - take that first split time away from the current race time for the exact time of the green light.
I've compared it (the PHP version) to code that I've got in use and you're not missing anything that I can see. I'm using cURL with a follow option rather than file_get_contents... maybe there's a redirect in there somewhere?
EDIT: longest 'contained' track, not longest of all tracks
The longest track since Westerweiterung2 - adding more than a mile and increasing the already high average speed by another 5%, while fixing many problems with the flow.
The horrific concrete of Westerweiterung2 has been replaced by only-slightly-iffy concrete. It's survivable, if not exactly pleasant, at its worst. The finish line and direction at start are standard WE1. Images attached.