The Police Officer would have to actually attempt to stun and or damage you first. Them running around with one of their main sweps doesn't show intent of anything.
Yes & no, anyone can say anything over voice chat but you can't always act on it. If a Police Officer simply says, "I'm gonna arrest you" that does not mean you have permission to gun them down; they still have to pose some sort of threat and sometimes words just aren't enough.
All of these things together are usually enough to prove intent, but each alone aren't a good enough reason except for the last. Swinging a stun stick at close proximity (where the only possible target is you) does show intent of arrest.
Going off of the scenario you described, it's very hard to say it's "obvious" that the player was about to arrest you. If they were smack dab in your face, then maybe you could say that's what they were going to do, but at the end of the day there was nothing done to 100% confirm they were going to arrest you; giving you no right to kill them.
If the Police Officer is actively swinging his stun stick, shooting & reloading his taser and following you for a suspiciously long time then these are all things you can clip to show their intentions. The rule isn't made so that a player can stand still, let a police officer walk towards him and then the player guns him down for it. It's there so that if you're attempting to escape from the Police Officer & the Officer won't give up on the chase then you can attempt to defend yourself.