Not your fault. They surprised you and got you off guard. Code enforcement, police, city they all will try and get you off guard. So will a thieves and other not so nice sorts.
I would still call the police and have them do extra patrols. Explain to them that there was no proper id shown and that the vehicle had a "volunteer code enforcement" sticker or magnet on it. Let them know no paperwork was shown and that you are concerned and frightened that someone may be casing your house for a robbery or to do harm to your pets.
They should be willing to come out to your area a few times a night to patrol.
One thing we did after having our vehicles vandalized was to put up flood lights on the house that are on low after dark but WHAM if someone triggers the motion sensor 500 watts of blinding light per fixture.
The neighbor across the street said "Wow those really light it up. I can see better in my driveway and garage with yours on than I can with my own on". LOL they come on when she opens HER garage door.
I got mine at Home Depot for less than 50 each.