Preheat oven to 400°. In a large skillet, heat oil over medium heat. Add onions; cook and stir until softened, 8-10 minutes. Reduce heat to medium-low; cook until deep golden brown, 30-40 minutes, stirring occasionally. Stir in 1/2 teaspoon salt and pepper.
Meanwhile, in a large bowl, combine flour, baking powder and remaining 1/2 teaspoon salt. Cut in shortening until mixture resembles coarse crumbs. Stir in milk just until moistened. Press into a greased 9-in. square baking pan; top with onions.
Combine egg and sour cream; spread over onion layer. Bake until golden brown, 35-40 minutes. Cut into squares. Serve warm.