Set oven rack 6 inches from heat source; preheat broiler. Bring water to a boil in a large skillet; add onion, zucchini, and yellow squash. Reduce heat; simmer, covered, until tender, 7 to 9 minutes. Drain. Transfer to a 1-quart baking dish. Sprinkle with oregano and ¼ teaspoon salt.
In a small saucepan, heat oil over medium heat. Whisk in flour, pepper, and remaining ¼ teaspoon salt; cook until foaming, then whisk in milk until thickened, about 2 minutes. Stir in Gruyère cheese until melted; pour over vegetable mixture.
Broil until browned, about 2 minutes. Sprinkle with more oregano and pepper.
