You are ok. Shaking the can is something everyone does, but I doubt it matters. The oil does not seem to separate or anything. Someone on another [chainsaw] forum poured some mixed fuel into a glass jar and let it sit on his workbench a long time. He never saw any separation at all. If it bothers you, pour the remaining fuel out of the saw and replace with shaken fuel. By the way, you'd have likely known the engine was damaged within a few minutes of running it, so you are fine.
As to the 5 gal. container, you should mix up only what you anticipate using for the next month or two. Less if you are in a humid region. Unless you have gas without ethanol. The alcohol is hygrophobic and attracts water molecules from the air and makes a mess of your gas. I live in a very dry area and have no problems for many months, but that's here. If some of the limb is lying in dirt, raise it up a smidgen with a 2 x 4 or something to get it off the ground. Or, cut it part way through and roll the limb over to finish the cut. Dirt will dull the chain in about a tenth of a second.
Every tank or two of gas used, flip the bar over top to bottom so it'll wear evenly and you'll get more life from it.