What is this?

That is an old school motion sensor alarm.
It connects to the horn circuit.
That little screw on top adjusts the sensitivity.

Basically just an arm inside that is suspended by a spring, and when the car moves the contacts touch making the horn honk.

They kinda sucked actually.:D
Yup, one of those old alarm sensors that set off the horn if you bumped the vehicle.