Preheat oven to 450 degrees. Spread 1/2 teaspoon butter on each bread slice and place 8 slices, butter side down, on a rimmed baking sheet. Divide cheese and ham evenly among slices, season with salt and pepper, and top with remaining bread slices, butter side up. Bake until bread is golden brown and cheese is melted, about 10 minutes, flipping halfway through.
Meanwhile, in a large nonstick skillet, melt 2 teaspoons butter over medium. Cook 4 eggs until whites are set and yolks are still runny, about 4 minutes; transfer to a plate and keep warm. Repeat with remaining butter and eggs. Top each sandwich with 1 egg. Season with salt and pepper and serve immediately.