Ok, I'm a "cop" that uses common sense. Here's my take on things.
There's always at least two sides to every story but if it happened as you outlined it here then I wouldn't have written you the ticket. I see traffic laws not as iron fisted limits but as guidelines that apply under most normal everyday circumstances. In my opinion, you can violate most any of them (have insurance and don't be drunk or else
) as long as you can articulate why you violated it.
In my experience most judges see it the same way. I started out not knowing the difference and writing most violations but after watching the judges over the years I learned how to weed out the honest actions on the roadside to avoid having to spend more off days in court to watch the judge do it for me.
I think most all officers mature in this respect as they gain experience. Some, though, are just diehard traffik nazis...
The thing is that each officer has discretion (whether or not they use it is another issue) in his/her enforcement of most laws unless department SOP says otherwise (in Georgia anyway). Some officers see the laws as clear cut limits and ticket any violation they see. Others, like myself, try to use common sense and just ticket the ones that blatantly have no regard for the law or public safety.
So, to answer your question, yes, I think that there are still some LE officers with common sense...
Oh, and a word of advice based on 11 years of courtroom experience. Please, whatever you do, don't state in court that you were unaware that the line was double yellow. I think you'd stand a far better chance of getting a break from the judge by being honest and explaining your situation, including being pelted with debris, and the truck's violation of the law you say he is violating. Just make dang sure that what the truck was doing was in violation of an actual law. I'm not doubting that the law you quoted exists, I just know after 11 years that there are lots of "urban myth" laws that someone was told about by their cousin's brother's girlfriend's sister's nephew. My favorite is that everyone in Georgia thinks it's against the law to drive a car without shoes on. I wish I had a dollar for each time I've watched women almost run off of the road trying to put their shoes on when approaching a license checkpoint.
If you want to go for a break from the judge please do your homework and be able to provide a copy of the law that the trucker was in violation of, don't lie to the judge (they've heard them all, trust me), don't show up in a shirt that says, F$%^ Tha Police
, present your case in a well organized manner in chronological order starting with approximately how long you'd been behind the trucker, approx. number of cars backed up behind you, how you were very careful about where and how you passed to insure that it was done safely, etc... If there were other locations that you could have probably pulled off the pass but didn't for safety conscious reasons then tell the judge that. kswaterbug also suggested some good ideas in the post above this one...
If you convince the judge that yes, you technically broke a law but you can articulate to him why you did and that you done it consciously and with the highest regard for safety then you might stand a good chance of getting some slack.
Also include that you pulled over the instant that you saw the officer and waited to explain your situation. Don't say that you "saw the cop" as you rounded the truck cab, say that you " saw the law enforcement vehicle by the roadside". Showing disrespect for the officer in court gives you the appearance of not respecting the law. Trust me, you don't want to create that impression with most judges. Fwiw, that is NOT the impression I get from your post here. Sounds to me like you used common sense. You could have just bashed cops without an outline of the situation like some do.
Another thing to mention is once you saw that the law enforcement officer pull out, you immediately stopped to wait for him and to explain to him why you had overtaken the truck against the double yellow.
Last of all, a free suggestion. Research your state's passing law. Georgia makes provisions for passing vehicles that are obstructing traffic flow regardless of the lines as long as it is done safely. Gotta get everyone around all the farm tractors and hay haulers out here somehow.
That may not be the case in Kali though... According to the circumstances though ( I wasn't there) that might be a cheesy defense ( like fighting a ticket based on errors in data fields of citations. That don't work in Georgia. Maybe in Kali...)
In my opinion, if you are guilty (technically you are unless there's a provision in the law and it applies here) then your best course if you go to court is to present your case honestly and hope the judge has/uses common sense. If you want to outright fight the ticket then get an attorney with experience in this matter. Ever heard the term jailhouse lawyer? That's the guys in jail that defended themselves. You shouldn't end up in jail over this incident but you could lose some $$$$ if you go about it wrong. Just my $.02...
Remember, all the officer has to do is testify that he saw you pass on the double yellow. He doesn't have to answer to the judge for not enforcing the laws that other motorists were in violation of at the time. Fwiw, he could always say that in this situation the person passing on a double yellow presented a higher degree of risk to public safety than the trucker who is actually slowing everyone down to safer speeds in a single lane. Either way, the other motorist's violation probably won't be recognized as a defense for your actions. What it is good for is articulating why you done what you done. I hope that makes sense.
Good luck if you decide to go to court. Maybe the judge will give you the break that it sounds like you should have gotten on the roadside.