Foil cycling technique for the VESUVIO spectrometer operating in the resonance detector configuration