My son, who will be 4 in a couple days, likes to try to tell me he is not going to clean something up. We clean together, usually, but he will sometimes pull a "that's M.'s job." Well, you bet HE will be cleaning up whatever he told me is my job, even if it takes him all day and he looses his privilidges (video games, leappad etc).
If he is acting out when you go out, you need to leave immediately. Tell him before you go that if he does whatever behavior you don't like, you will leave. Be specific. Take a trip to the library (or somewhere he enjoys) for the sole purpose of reinforcing this. Right before you enter, say "Joey, if you yell in the library, we will have to leave right away because that behavior is not allowed." Then go to the library and wait for it. As soon as it happens, take his hand and lead him out the door with no books. When you are outside you remind him of what you said.
Two things - make sure it's a place he enjoys going to. If he hates going to the the grocery store with you and you leave as soon as he screams, he will do it every time to get out of it. You have to find his currency at each place. For my kids, if they don't behave in the grocery store, there are no treats, or the treats they already picked out are put away. Also, it gives you leverage because you can say "remember when we had to leave the library because you didn't listen to M.."
As for talking to people and telling them what to buy. I'd just laugh it off with the person and be sure to tell your son, where they can hear, that everyone can buy what they like and we need to pick out only our food.
The swearing has to be addressed every time. What is his currency? Video games, TV time, a favorite toy. It needs to be taken away. Have one conversation with him, then start the consequences. You need to be a good example too and not say them yourself - even a slip.
The bottom line here is consequences for behavior choices (good and bad), and CONSISTENCY. Pick your battles, but you must win and you must be consistent. Praise the good behavior, but within reason.