Bring cabbage pieces to a boil in a pot and simmer until just tender, about 5 minutes. Drain, then transfer cabbage to a 2-quart baking dish.
Melt 1/4 cup butter in a skillet over medium heat. Stir in corned beef and onion; cook and stir until the onion has softened and turned translucent, about 5 minutes. Break up any large chunks of corned beef.
Spread corned beef mixture over cabbage.
Melt remaining 1/3 cup butter in the same skillet over medium heat; whisk in flour.
Pour in milk and season with salt and pepper. Continue whisking until sauce comes to a simmer and is thickened, about 5 minutes.
Pour sauce over corned beef and cabbage mixture.
Bake in the preheated oven until bubbly, about 30 minutes.