I did some braking systems for brushed motors many years ago. With the right controller, you can get nice variable braking that sends the energy back to the battery even at low speeds. It works like a boost converting switching power supply. You short the motor windings for a brief time and when the short releases, a voltage spike will be produced by the inductance of the motor windings that has more than enough voltage to put charge into the battery. The short is done by FETs at the switching frequency of the controller and the duty cycle determines the braking current.
With the right electronics, you can have a constant braking force independent of speed. I had a setup like this on one of my scooters. The braking was activated by a switch on the brake lever. The braking current limit was set to a level where it worked without damaging anything. The braking force would stay steady until it got down to walking speed, then taper off.
It would be possible to make a separate braking controller and add it to the existing motor controller. They would be very similar in construction. In practice, the tricky part is interfacing the two so you can't apply braking when the throttle is on or vice versa.
A much more low-tech approach is simply a big braking resistor across the motor. This will be dependent on speed, so not as nice. More force at higher speed. If you're going too fast when you activate it, something could be damaged. I did a few of these too. No energy is recovered, but you save wear on the brakes and don't have fading issues on long hills. Braking resistors were just long pieces of wire wrapped around the frame to dissipate the heat. You can have more than one tap, giving multiple levels of braking force.
"One test is worth a thousand opinions"