Why not:
int result = ( level.gametype.inverseScore ? -1 : 1 ) * ( score_b - score_a );