In a saucepan over medium-low heat, melt butter. Add onion and cook for about 30 seconds. Stir in flour, salt, pepper, and sugar; blend well and continue cooking and stirring until bubbly. Stir in sour cream and cook over low heat for about 1 minute.
Spread beans over the bottom of a buttered casserole (11x7x2-inch baking dish or similar size). Sprinkle shredded cheese over green beans then pour sauce evenly over; top with buttered corn flake crumbs.
Bake green bean casserole at 400° for 20 minutes.
Calories per serving: 260