The Orion nebula is a prime example of a massive star-forming region in our galaxy. Observations have shown that gravitational and magnetic energy are comparable in its integral-shaped filament on a scale of ∼1 pc, and that the population of pre-main sequence stars appears dynamically heated compared to the protostars. These results have been attributed to a slingshot mechanism resulting from the oscillation of the filament by Stutz & Gould. In this paper, we show that radially contracting filaments naturally evolve towards a state where gravitational, magnetic, and rotational energy are comparable. While the contraction of the filament will preferentially amplify the axial component of the magnetic field, the presence of rotation leads to a helical field structure. We show how magnetic tension can give rise to a filament oscillation, and estimate a typical time-scale of 0.7 Myr for the motion of the filament to the position of maximum displacement, consistent with the characteristic time-scale of the ejected stars. Furthermore, the presence of helical magnetic fields is expected to give rise to magneto-hydrodynamical instabilities. We show here that the presence of a magnetic field significantly enhances the overall instability, which operates on a characteristic scale of about 1 pc. We expect the physics discussed here to be generally relevant in massive star-forming regions, and encourage further investigations in the future.