How to... Automatically update a field in "Contacts" that i change or add in "Accounts"

How to... Automatically update a field in "Contacts" that i change or add in "Accounts"

Hi There
HELP ;_)
I have a field in ACCOUNTS called REPS that has drop down options (Global Drop down List)
I want to Update a field in CONTACT called REPS (Global Drop down List) automatically  for all contacts associated to the Company in Accounts
I tried to copy a script and edit it but i ge an error

to be honest.... i have no idea what im trying will even work

Screen Shots below

Script:

// Fetch the Account details using the Account ID
accountDetails = zoho.crm.getRecordById("Accounts",accountId);
// Check if the required fields are present in the Account
if(accountDetails.get("Rep") != null)
{
rep = accountDetails.get("Rep");
// info rep;;
// Fetch related Contacts
relatedContacts = zoho.crm.searchRecords("Contacts","(Account_Name:equals:" + accountId + ")");
// info relatedContacts;
for each  contact in relatedContacts
{
// Update the Contact fields
contactId = contact.get("id");
// info contactId;
updateMap = Map();
if(rep != null)
{
updateMap.put("Rep",rep);
}
// info  updateMap; 
updateResponse = zoho.crm.updateRecord("Rep",contactId,updateMap);
info updateResponse;
}
}