If your question is supposed to be: "the enemy is coming at me! I'm not sure I can hold them off, what would help more - building a wall or just building another defender?" then hmmm... I'd probably say the wall because it will help ALL of your defenders as opposed to just giving you one more guy with lower bonuses.
The wall could make it so that each defender kills 2 attackers rather than just 1, so if you have 3 defenders and they are bringing a stack of 8 at you, building the wall means you kill 6 and lose 2, you saved the city (and hopefully have reinforcements on the way from somewhere else to hold off the last 2 injured attackers). If you built another unit, you only kill 4 and you lose 4 - you lost the city. *These figures were just made up as an example.
The wall could make it so that each defender kills 2 attackers rather than just 1, so if you have 3 defenders and they are bringing a stack of 8 at you, building the wall means you kill 6 and lose 2, you saved the city (and hopefully have reinforcements on the way from somewhere else to hold off the last 2 injured attackers). If you built another unit, you only kill 4 and you lose 4 - you lost the city. *These figures were just made up as an example.