i think there are some problems with the way you handled this issue...
firstly, cops are very much on a power trip and you don't want to challenge this. I would have waited in my car and acted very politely. even if you are angry, never raise your voice as ths will just incite an unwanted response from the cop. treat them the way you want them to treat you, confucious say...
secondly, if you act appropriately and you still get treated like shit, just calmly say something along the lines of "excuse me sir. can i please have your name and badge number. i feel the way i have been treated is inappropriate and wish to take this matter further". i guarantee if you say this calmly then the cop will get scared and defend himself and give you a warning instead of a fine... and if they do still give you a stupid fine then take it to the local station and complain...complain...complain...complain. its the only way shit gets through to them...
BUT this would only work if you don't act like a coc.k to them in the first place.
Waz.