Thumbs up for the desgin! Works fine out of the box.
I use panheads. The $fn=8 for the cylinder to create the counterbore for the panhead makes it very difficult the screw the 2nd panhead in. I propose something like
This way the counterbore becomes a cylinder with ~0.5mm segments.