All a tail light consists of is basically an LED, and perhaps a heat sink if the LED needs it, plus a battery, plus a microchip to run the LED. Plus a case and some sort of mounting for a seatpost or rack. The case usually includes some type of a lens over the LED. Constructing one shouldn't be that difficult. I can probably do a prototype for USD $40; that price would let me overbuild to some degree.
Bob
Bob