Blanch the beans: Bring a large pot of water to a rolling boil and season with 2 tsp kosher salt (from the divided amount). Add green beans; cook 2–3 minutes until vivid green and crisp-tender.
Shock: Transfer beans to an ice bath to stop cooking. Drain well and pat dry. (You can do this up to 24 hours ahead; refrigerate in a towel-lined container.)
Toast the almonds: In a large dry skillet over medium heat, toast almonds 2–3 minutes, stirring, until golden and fragrant. Transfer to a bowl.
Sauté aromatics: Add butter (or olive oil) to the skillet. When melted and foamy, add shallot and a pinch of salt; cook 1–2 minutes until translucent. Stir in garlic and thyme; cook 30 seconds until fragrant.
Glaze the beans: Add blanched beans to the skillet; toss 2–3 minutes to warm through. Sprinkle with remaining salt and pepper.
Brighten: Remove from heat. Stir in lemon zest and lemon juice (and red pepper flakes if using). Taste and adjust—more salt, pepper, or lemon as you like.
Serve: Fold in most of the toasted almonds, transfer to a platter, and scatter remaining almonds and a pinch of fresh thyme on top.