I have finally managed to print tiny little ball-chain gears that work with 3.3mm and 3.5mm diameter ball-chain and still fit on the NEMA17’s 5mm output shaft. The trick is to print the gears in two pieces.
As you can see in the photograph, I print two 4mm thick sections of gear and put them on the shaft with an M5 washer sandwiched in between. Make sure the teeth are lined up on both gears. This gives a channel to guide the ball-chain down the centre of the gear, and grips the sides of the balls adequately. As the gears age, it will also stop the balls grinding their way too far through the PLA, though I must admit that my experience with ball-chain Z axis gears suggests this will not be a major issue.
The gears themselves are designed to be “spiky”, but the vaguearities of the printing and rendering process lop the spikes off and leave enough by accident to produce a functioning gear!
Ball-chain gears on Thingiverse