In medium saucepan over medium heat melt butter. Add grated onion, oregano, and 1/2 teaspoon salt; cook, stirring occasionally, until liquid has evaporated and onion is golden brown, approximately 5 minutes. Add garlic and cook until fragrant, about 30 seconds. Stir in tomatoes and sugar, increase heat to high, and bring to simmer. Lower heat to medium-low and simmer until reduced to 2 1/2 cups, 25 to 30 minutes. Off heat, stir in basil and oil, then season with salt and pepper.