Does it have to be two wires? There are many multicore cable solutions cheaply off the shelf, e.g. network cable, telephone cable, or even low voltage solenoid power cable for irrigation systems. You can use two conductors for power and have other conductors left over for communications. Mechanical solutions are often simpler than electronic solutions.
The fire panels that did this were designed within the constraints of an existing two-wire installation, and for retro-fitting newer, addressable and synchonizable alert receivers instead of just a ringing bell . Some of these wall mounted alerts even had digitized voices for emergency messages, pre-recorded and stored locally at the wall mounted alert, and some models had the capability of a live operator voice originating from a control panel. There was a sync pulse on the 2 wires as well, so that during an alert all the units on the wall would flash in unison, or go whoooooooooOOOOOOOOOOPPPP in unison. This was all into existing wiring, which was usually just 24V bell wire. (i.e. zip cord, low voltage, 2 wires, 18-22 awg)
In new installations I suspect they use multi-core wire now.