Whisk soy sauce, oyster sauce, mirin, rice vinegar, brown sugar, and black pepper in a small bowl.
Soak udon in hot water until loosened, 1–2 minutes. Drain well.
Heat a large skillet over medium-high. Add half the oil. Sear shrimp with a pinch of salt until just pink. Remove.
Add remaining oil. Stir-fry onion and carrot until lightly softened, about 2 minutes.
Add cabbage, garlic, and ginger. Cook until fragrant and the cabbage wilts, 2–3 minutes.
Toss in the drained udon. Splash in water as needed to separate and heat through.
Return shrimp to the pan. Pour in the sauce and stir-fry until everything is glossy and coated, about 1 minute.
Drizzle with sesame oil. Fold in most of the scallions and the red pepper flakes if using. Serve topped with remaining scallions and sesame seeds.