If you take a look at the entire DO block, you can inspect the buffer scoping:
DO iEntry . . .:       /* No buffer scoping at all */
  FOR EACH Bin . . .:                /* Weak-scoped reference to Bin */
  .
  .                                  /* --Bin is scoped to this block. */
  .
  END.
  .
  .
  .
  REPEAT PRESELECT EACH Bin. . .:    /* Weak-scoped reference to Bin */
  .
  .                                  /* -- Bin scoped to this block too */
  .
  END.
END.

The DO block itself does not scope any records. The FOR EACH block and the REPEAT PRESELECT EACH block each scope the Bin record with a weak scope. This is okay, and the Bin buffer is scoped to each of these two blocks in turn.

The final block of code walks through the list of best Warehouses for this Order’s items. At this point the cBestList variable holds a list of numbers for each Warehouse. Each number is the count of Items where that Warehouse has an inventory at least 100 better than the next best Warehouse. This block checks whether there is a Warehouse that is the best for either all or all but one of the Items. If so, you find that Warehouse record and save off the WarehouseName to pass back. By now all the statements and functions in this block should be familiar to you.

To end the procedure, use the following code:

DO iEntry = 1 TO NUM-ENTRIES(cBestList):
  IF INTEGER(ENTRY(iEntry, cBestList)) >= (NUM-ENTRIES(pcItemList) - 1) THEN
    DO:
      FIND Warehouse WHERE Warehouse.WarehouseNum = iEntry.
      pcBestWarehouse = Warehouse.WarehouseName.
      LEAVE.
    END.
END.

This procedure is a little complicated, but these examples show how the different block types interact and how to use some of the built-in functions listed in Use Basic ABL Constructs.