Melt 2 tablespoons butter in a large skillet over medium heat. Stir in flour until smooth, and cook for one minute. Stir in the salt, sugar, onion, and sour cream. Add cooked green beans and half of the can of fried onions,stir to coat.
Transfer the mixture to a 9x13 casserole dish. Spread shredded cheese over the top. Then top with remaining fried onions.
Bake for 30 minutes in the preheated oven, or until the top is golden and cheese is bubbly.