```$((`grep -c '^processor' /proc/cpuinfo`+1))```

You can store that in a variable at the top of the script (outside the function) and use it in all of the emerge commands.

You don't need to do &&'s, since already if any of the commands fail, the script will exit.