Preheat the oven to 350 degrees F (175 degrees C). Grease a 9x13-inch baking dish.
Bring a large pot of lightly salted water to a boil. Cook spaghetti in the boiling water, stirring occasionally, until tender yet firm to the bite, about 12 minutes. Drain; transfer to a large bowl.
Melt margarine in a skillet over medium heat. Add onion; cook and stir until soft and translucent, 5 to 7 minutes. Stir into spaghetti along with chicken, evaporated milk, cream of chicken soup, 4 ounces Cheddar cheese, celery salt, salt, and black pepper; toss to combine. Transfer to prepared dish; sprinkle remaining 4 ounces Cheddar cheese over top.
Bake in the preheated oven until bubbling and cheese melted, about 45 minutes.
