Bloch oscillations of exciton-polaritons and photons for the generation of an alternating terahertz spin signal