Beamforming and Resource Allocation for Delay Minimization in RIS-Assisted OFDM Systems