Buffer tank on input or output of tankless water heater?
A buffer tank must be on the output side of a tankless water heater. If you put the tank on the input side a bunch of unintended consequences happen:


The buffer tank will do the bulk of the water heating, until it is overwhelmed.
As long as hot water use continues, the buffer tank will continue running as it tries to keep up with raising the incoming water to its set temperature. 
You might still get a "cold water sandwich" as the buffer's hot water supply runs out. That's because your tankless will be sitting around doing nothing at all while the hot water runs, because the water's already heated! When the buffer runs out the temperature drops and the tankless kicks on (but might need more time to warm up fully).


On the other hand, when you put a buffer tank on the output side of the tankless, sustained use of hot water will shift most of the work to the tankless. It will be heating the water before it reaches the buffer, and the buffer will do nothing during those extended uses of hot water where the tankless is most efficient.

If you want to add a timer on the buffer, the way to do that would be to both shut off the buffer tank's heating and route the water around the buffer (rather than through it), using some electronic 3-way valves.

Please note, however, that there are better solutions to the cold water delay problem. For example:


Use a demand-activated recirculation system. You have to train your family to press a button a minute or two before they want to start a shower, but it's pretty nice having the water hot immediately after.
Configure your tankless water heater to use a recirculating mode that keeps its heat exchanger warm. This will consume more energy, but is designed to ensure it's pre-heated during periods of likely demand. My Navien CH-240, for example, can be configured to run in recirculating mode during specified 30-minute intervals via its remote control panel.