You can of course use scripts to duplicate the material around, but I have the feeling this will create a trap for you in another corner: When animating, you somehow need to animate every single material, and this I cannot imagine to be comfortable.
I suggest a slightly modified approach: Use one single material on all white keys, and create a node setup in Cycles which will hook up to an attribute of your object. In essence, you can tell the material:
hey, if the attribute of the object which I live on has a value of X, do this. Else, do this.
In other words: If X == 5 (given that X is the value you animate), and attribute Y on the object == 5 as well, glow. Otherwise, stay non-glowing. A simple Blend file showing this approach can be found here:
Edit
Animated ID value in the Blend file can be tested here:
In this Blend file, each cube has a different Object Index, starting at 0 and going up to 6. I'm using the Object Index Node to get my source value to check against:
But you could also generate a custom property on each object and read that using the Attribute Node. Whatever you decide, the next step is to generate a node tree similar to this:
The framed part is the IF X == Y expression. It works like this: Say we want to check if the Object Index is 3. Set the value of the top input to 3. Now, the top half of the IF expression will deduct a threshold (0.1), giving you 2.9, and then feed that into a Less Than node. So, for all Cubes with Object Index 0, 1 and 2, this will be 0 (=False =Black), as their Object Index is not less than the ID we're checking against. The bottom half works reversed, now the cubes with Index 0, 1, 2 and 3 will output white. You can preview the node outputs of less than and greater than nodes to see what I mean. The multiply nodes will multiply the results together. Since only the Cube with ID 3 received white in both cases, and only 1 * 1 = 1, it will be the only white one in the end.
The rest is 'normal' shader switching as you've done plenty of times. Now, the only value which you need to animate is the ID value in the Node Tree. You could even create an expression on it (enter #frame into the field for instance to setup a driver which links to the scene frame).