If you're riding in race kit, then you can use one of your jersey's rear pockets for this purpose. Putting the sunglasses away is really easy, but when getting them out again it can be a little fiddly to open the arms with one hand, the first few times you do it. You can even share the same pocket with something else, as long as it's not keys or a water bottle.
For race kit or light everyday clothes, you can hook one arm into the front of your T-shirt, shirt, jersey, jumper, etc. like a tourist does when walking around. You need to be confident of how stiff the arms are, but unless the sunglasses are wont to swing open on their own, it's perfectly safe. I wouldn't recommend trying it on a heavy jacket with a zip front or metal buttons, mind.
This is probably not a useful suggestion for you, but some rucksacks have chest straps to keep them stable on the move: it's usually possible to stick one arm of the glasses vertically through part of this assembly, such as the loop where the fastening is attached. If it's a snug fit, you can safely keep your glasses there even if the arm swings freely.