A bi-directional flyback could be made to work, but you would need 3 x 1kV mosfet or IGBT in series on the HV side (due to the flyback effect when you are discharging the cap), also when you are discharging most of the energy will arrive back at the input, so you will need large-ish caps on the LV side if the voltage there is not to increase too much during discharge of the HV side. It would be quicker and simpler to build two converters, one for charge and one for discharge, or more simply get some 2.5kV igbts to do the discharge in a controlled linear fashion, regards, Orson Cart.