Your question is confusing but if I am understanding it correctly, you don't need to put your whole attack code twice. Do something like if (GUI.AttackAreaSelectedByPlayer.contains(myPlayer) {
//Attack code } else {
//WalkToArea
} this will separate your two areas and you will only need the code once.