Google Scripts: Problems with Contacting Spreadsheets. Names with address, phone number, e-mail and job titles

I have over 500 contacts in Google. I want to list all the contacts associated with a particular company in a worksheet. When I run the following script, I get a time-out error.

                Function Step2_Contacts (x) {
// Add contact information
var x = "company name";
var ss = SpreadsheetApp.getActiveSpreadsheet ();
var sheet = ss.getSheetByName (x);
var contacts, outputTitle = []outputEmail = [], outputPhone = []outputAddress = []output_name = [], outputNotes = []cStart = ContactsApp.getContacts ();
for (var i = 0, iLen = cStart.length; i <iLen; i ++) {
var fullname = cStart[i].getFullName ();
Contacts = ContactsApp.getContactsByName (full name);
for (y in contacts) {
var company = contacts[y].getCompanies ();
var email = contacts[y].getEmails (ContactsApp.Field.WORK_EMAIL);
var phone = contacts[y].getPhones ();
var addr = contacts[y].getAddresses (ContactsApp.Field.HOME_ADDRESS);
var notes = contacts[y].getNotes ();
for (var z in state) {
if (company[y].getCompanyName () == x) {
outputTitle.push ([company[z].getJobTitle ()]);
outputEmail.push ([email[z].getAddress ()]);
outputPhone.push ([phone[z].getPhoneNumber ()]);
outputAddress.push ([addr[z].getAddress ()]);
outputName.push ([fullname]);
outputNotes.push ([notes]);
};
};
};
};

// Add contact information
sheet.getRange (7, 4, outputName.length, 1) .setValues ​​(outputName);
sheet.getRange (7, 5, outputTitle.length, 1) .setValues ​​(outputTitle);
sheet.getRange (7, 6, outputEmail.length, 1) .setValues ​​(outputEmail);
sheet.getRange (7, 7, outputPhone.length, 1) .setValues ​​(outputPhone);
sheet.getRange (7, 8, outputAddress.length, 1) .setValues ​​(outputAddress);
sheet.getRange (7, 9, outputNotes.length, 1) .setValues ​​(outputNotes);
};

What I think is that each loop of the arrays adds another dimension to all the arrays listed in the loop.