I can think of doing this project several different ways.
Mechanical method: The reservoir that would fill the toilet tank would have a float system just like the toilet tank system. If the reservoir was empty the float would be down and the valve would be open. When the shower is turned on, the open valve would cause the water to go to the reservoir instead of the shower head. When the float shuts off the valve, the water would return to the shower head. The system could be tuned by adjusting the float height, so that only the cold water would be bypassed to the reservoir. The mechanical method would be very robust, but could only handle a 1:1 shower to flush ratio.
Electrical method: By using electronics and sensors, the reservoir could be larger, potentially saving more water. The water could bypass the shower head until a specific temperature is reached. The electrical method would also allow for other ideas to be incorporated (like volumetric feedback etc).
Either method would be an add-on to existing systems, not a replacement. If no saved water was available, the toilet tank would refill in the normal manner.