That's a good idea. Motorcyclists are taught to rapidly close and open the brake, in order to flash the rear brake light for extra visibility when stopping.
Thats already a feature in most modern cars. Seen it plenty of times on the Autobahn. It's really helpful/a life saver to know if the car in front of you just slows down or is doing an emergency brake.