Instead of setting the variable within a ForEach loop, why don't you try to handle the logic within the Copy Activity or Lookup activity itself dynamically? at least you will keep the variable setting logic scoped to the current iteration.
In your Copy Activity, try the following :
@concat('SELECT * FROM ', item().source_entity, ' WHERE ',
if(equals(tolower(item().source_entity), 'comment'), 'LastEditDate', 'LastModifiedDate'),
' >= ', variables('v_last_modified_date_as_of'),'T00:00:00Z')