Scalar field cosmologies with a generalized harmonic potential and a matter fluid with a barotropic equation of state (EoS) with barotropic index γ for the locally rotationally symmetric (LRS) Bianchi I and flat Friedmann–Lemaître–Robertson–Walker (FLRW) metrics are investigated. Methods from the theory of averaging of nonlinear dynamical systems are used to prove that time-dependent systems and their corresponding time-averaged versions have the same late-time dynamics. Therefore, the simplest time-averaged system determines the future asymptotic behavior. Depending on the values of γ, the late-time attractors of physical interests are flat quintessence dominated FLRW universe and Einstein-de Sitter solution. With this approach, the oscillations entering the system through the Klein–Gordon (KG) equation can be controlled and smoothed out as the Hubble parameter H – acting as time-dependent perturbation parameter – tends monotonically to zero. Numerical simulations are presented as evidence of such behavior.