To avoid getting too complicated with microcontrollers...
A Yanmar magnetic tach sender is mounted close to the teeth on the flywheel ring gear. It puts out an AC voltage that increases with speed. At high RPM, I think it was 18 volts.
If your car has anti-lock breaks, there is a disk on each wheel that looks like a gear. If you mount a magnetic tach sender close to the teeth on that gear you will get a AC voltage that increases with speed. If you make it DC with a rectifier and smooth it with a capacitor, a comparator can turn on when your signal matches a reference voltage. BUT, the signal can't go above your 12 volt supply voltage. That ABS disk won't pulse as fast as a flywheel but you need to test it.
If when reducing your speed, the spoiler retracts before you want it to, then you will need a "window" comparator.
This little module will make things easier for you.
**broken link removed**
DC 12V 30MA 1 Channel Voltage Comparator Module LM393N LM339 IC Chip
Function:
1. Enter a voltage and the reference voltage contrast on the module (The reference voltage can be set by an adjustable electrical overcast), When the input voltage is greater than the reference voltage, Relay closed. When the input voltage is less than the reference voltage, Relay does not operate
2. Respectively inputted two special Compare Voltage signal 10 and 12, When the voltage signal 12 is greater than voltage signal 10, Relay closed. When the voltage signal 12 is less than voltage signal 10, Relay does not operate
3. Enter a voltage and the reference voltage contrast on the module (The reference voltage can be set by an adjustable electrical overcast),When the input voltage is less than the reference voltage, Relay closed. When the input voltage is greater than the reference voltage, Relay does not operate (opposite with function 1)
The reference voltage: The reference voltage of the module is the input voltage obtained through precision resistor divider, It determines the range of input voltage reference voltage, For example, the input voltage is 12V, then the reference voltage can be set in the range of 0-12V.
Operating voltage: DC12V
When the comparator energizes the DPDT relay the motor raises the spoiler until the up limit switch opens, stopping the motor.
When the comparator de-energizes the DPDT relay the motor lowers the spoiler until the down limit switch opens, stopping the motor.
https://www.midtronics.com/shop/products-1/integrated-solutions/midtronics-magnetic-pick-up-sensors
Other members are welcome to critique / refine this.