Preheat oven to 375°. In a medium saucepan, melt butter. Add onions and cook until soft, stirring occasionally, about 4 minutes. Sprinkle flour and paprika over and cook, stirring constantly, 1 minute.
While whisking, slowly pour in milk. Bring to a simmer and continue to whisk until thickened, about 3 minutes. Stir in ham and season with salt and pepper.
Layer half the potatoes in the bottom of a 3-quart baking dish and season with salt and pepper. Spoon half the sauce over and sprinkle with half the cheddar. Repeat with remaining potatoes, sauce, and cheese.
Cover dish with foil and bake until potatoes are soft, about 40 minutes. Remove foil and continue to bake until cheese is golden and bubbly, about 25 minutes more.
Sprinkle with chives before serving.