GRB 210731A was a long-duration (T_90_=22.5s) gamma-ray burst discovered by the Burst Alert Telescope aboard the Neil Gehrels Swift Observatory. Swift triggered the wide-field, robotic MeerLICHT optical telescope in Sutherland, which began observing the BAT error circle 286 seconds after the Swift trigger and discovered the optical afterglow of GRB 210731A in its first 60 second q-band exposure. Multi-colour observations of the afterglow with MeerLICHT revealed a light curve showing three peaks of similar brightness within the first four hours. The unusual optical evolution prompted multi-wavelength follow-up observations spanning X-ray to radio frequencies. We present the results of our follow-up campaign and interpret our observations in the framework of the synchrotron forward shock model. We perform temporal and spectral fits to determine the spectral regime and external medium density profile, and perform detailed multi-wavelength theoretical modelling of the afterglow following the last optical peak at ~0.2 days to determine the intrinsic blast wave parameters. We find a preference for a stellar wind density profile consistent with a massive star origin, while our theoretical modelling results in fairly typical shock microphysics parameters. Based on the energy released in gamma-rays and the kinetic energy in the blast wave we determine a low radiative efficiency of ~0.02. The first peak in the optical light curve is likely the onset of the afterglow, while we find that energy injection into the forward shock offers the simplest explanation for the subsequent light curve evolution, with the blast wave kinetic energy increasing by a factor of ~1000 from the first peak to the last peak, indicative of substantial energy injection. Our highest-likelihood theoretical model over-predicts the 1.4GHz flux by a factor of approximately three with respect to our upper limits, possibly implying a population of thermal electrons within the shocked region.