Here is an example of a K# macro you can use in the ShowToRoles field:
{%if(Contains("|2454|1245|1454|","|" + NodeID +"|") == true)
{
return "Editor"
}
else
{
if(Contains("|2454|1245|1454|","|"+ NodeID + "|") == true)
{
return "EditorB"
}
else
{
return "Editor;EditorB"
}
}
%}
Apparently K# doesn't like "else if" so I had to nest the second condition.
I am using the NodeIDs because it is much easier to code than something like the NodeAliasPath or NodeGuid, however you could use any other condition that is easy for you to check and works for your scenario. For example, if all of the pages you wanted to show the webpart for EditorB on were under a specific path, you could use this expression in your condition "StartsWith(NodeAliasPath,"/A/ParentPath/")"
If you feel that it is easier for you to just edit this web part's properties to add node ids to the K# macro than to mess around with cloning page templates, then use this method. Otherwise use the method suggested by Zdenek.
If it were me, and I didn't have to make it so other people could control the visibility of these webparts, I would use the K# macro.