Interesting. It could use conventional components like a flip flop for the logic, but I suspect it will have a PIC or Arduino IC in there with a little program to energise the relay coil when the LED circuit is made. At least that would be how I'd do it to make it that bit more difficult to reverse engineer (even if the program should be pretty simple).
A good idea though and I'd be interested in looking under the plastic!