Tom said he would draw her a map if necessary.

Literal

Necessary [conditional-なら] her [to-に] map [object-を] drawing [for-あげる] [quotative-と] Tom [topic-は] said.

書いてあげると uses てあげる (benefactive — doing for someone's benefit). なら is the topic-conditional 'if it's the case that.' と marks the quoted speech.