Bring a large pot of water to boil. Add squash, and cook until tender. Drain well.
Place squash in a large mixing bowl. Add butter, reserving 1/2 tablespoon, to the squash and mash well. Mix bell pepper, sugar, onion, egg, mayonnaise, salt and pepper, cheese and nuts to the mixture.
Transfer the mixture to a 1-quart casserole dish. Top with bread crumbs. Dot with the reserved butter.Bake at 350 degrees F (175 degrees C) for 35 to 40 minutes.