1) You can add the duarouter option --unsorted-input
The downside of this is that the input is read completely into memory before writing output (By default processing is stream-based to conserve memory).
Alternatively, you can just put the input in separate files and call duarouter twice. I find that if often helps to keep different types of traffic in separate route files.
2) As soon as a vehicle gets the 'line' attribute it is recognized as public transport. By default, duarouter does not route public transport data.
You can change this behavior by adding the option --ptline-routing
3)
a) All detectors allow retrieving the ids of detected vehicles. You would then have to retrieve the line attribute for each of the vehicles to check whether one of them is a bus
b) you could add a context subscription to the traffic light junction to continually retrieve the id and line attribute for all vehicles in a radius
c) continually monitoring the buses isn't a bad idea either
The advantage of a) might be the ability to model the limited information stream often found in the real world. b) and c) are probably more convenient. Supposedly c) is more efficient if you have only a few buses and lots of background traffic.
regards,
Jakob