Foams have unique rheological properties that range from solid-like to fluid-like. We study two-dimensional non-coarsening foams of different disorder under shear in a Monte Carlo simulation, using a driven large-Q Potts model. Simulations of periodic shear on an ordered foam show several different response regimes. At small strain amplitudes, bubbles deform and recover their shapes elastically, and the macroscopic response is that of a linear elastic cellular material. For increasing strain amplitude, the energy-strain curve starts to exhibit hysteresis before any topological rearrangements occur, indicating a macroscopic viscoelastic response. When the applied strain amplitude exceeds a critical value, the yield strain, topological rearrangements (T1 events) occur, the foam starts to flow, and we observe macroscopic irreversibility. We find that the dynamics of topological rearrangements depend sensitively on the structural disorder. Structural disorder decreases the yield strain; sufficiently high disorder changes the macroscopic response of a foam from a viscoelastic solid to a viscoelastic fluid. This wide-ranging dynamical response and the associated history effects of foams result from avalanche-like T1 events. The spatio-temporal statistics of T1 events T1 do not display long-range correlations for ordered foams or at low shear rates, consistent with experimental observations. As the shear rate or structural disorder increases, the topological events become more correlated and their power spectra change from that of white noise toward $1/f$ noise. Intriguingly, the power spectra of the total stored energy also exhibit this 1/f trend.