Preheat oven to 350°F (175°C). Grease a 9x13 inch baking dish with butter or cooking spray.
In a large mixing bowl, combine ground beef, diced onion, breadcrumbs, egg, 1/4 cup milk, 1 teaspoon salt, and 1/2 teaspoon pepper. Mix gently with hands until just combined. Press mixture evenly into the bottom of prepared baking dish.
Bake the meatloaf layer for 20 minutes. It will not be fully cooked yet.
While meatloaf bakes, cook macaroni according to package directions until al dente. Drain well and set aside. Do not rinse.
In a medium saucepan over medium heat, melt butter. Stir in flour and cook for 1 minute, stirring constantly.
Gradually whisk in 2 cups milk, adding slowly to prevent lumps. Cook while whisking constantly until mixture thickens and coats the back of a spoon, about 5 minutes.
Stir in 1/2 teaspoon salt, 1/4 teaspoon pepper, paprika, and dry mustard. Add 1 1/2 cups shredded cheddar cheese and stir until completely melted and smooth.
Add the cooked macaroni to the cheese sauce and stir until every piece is well coated.
Remove meatloaf from oven. Spread the mac and cheese mixture evenly over the meatloaf layer. Sprinkle remaining 1/2 cup cheddar cheese on top.
Return to oven and bake for an additional 25 minutes, or until cheese is melted and bubbly with golden spots forming around edges.
Let casserole rest for 10 minutes before cutting into squares and serving. This helps it set for cleaner slices.