Brainonska nailed it, available oxygen is the key to the presence/absence of color. Swirling the flask introduces oxygen (in the form of air) and causes the solution to revert back to methylene blue, oxidized form.
The gif image is great, it shows the actual structures of the colored and colorless compounds. In a nutshell, the reason some compounds exhibit color is because they absorb/emit light in the visible portion of the spectrum. The structural feature that is responsible for this is conjugation, or alternating single and double bonds (ex. C=C-C=C-C=C... and so on). As you can see, the upper molecule has this feature to a great extent, but the reduced form (lower molecule) has the alternating bond feature 'interrupted' at the nitrogen (N) atom, hence it is colorless.
OP, are you presenting to a chemistry class, or a non-technical audience?