I would swap out the bulb for LED. Less load on the computer driving the light.
Wiring is pretty simple. Computer supplies the ground, ignition supplies the power. The check engine warning light is negative switched, always has power but the computer decides if to apply ground. If you look at the original brake warning light wiring it is nearly identical. Switched ignition (or was it accessory power?) to the light and the ground was the imbalance switch.