In a large bowl, combine tomatoes, basil, onions, oil, lemon juice, garlic, sugar, salt and pepper if desired. Cover and refrigerate for at least 15 minutes.
Meanwhile, cook pasta according to package directions until firm to the bite; drain and rinse with cold water. Transfer to a large salad bowl. Stir in the ham, olives and basil. Pour dressing over salad; toss to coat.