Just a suggestion: Why not let each miner decide for himself, out of the submitted user programs, which one he works on?
Honest, financially-motivated miners will work on whichever seems to them to be the most lucrative. Honest, altruistic miners might choose to work on projects they deem to be more socially valuable, or which they just find more interesting. Attackers will find a way to work on their own programs if that's what their attack needs, no matter how you arrange the work to be chosen, so your defenses against such attacks must not rely upon attackers never running their own programs.