The actual events in the ending are foreshadowed when Roy warns Mr. Buckley-whose first name isn't given, and is described as looking "like a farmer dressed for Sunday". Then Buckley writes the note that is then delivered to Tom. This foreshadows the fact that the note is significant, since Tom goes and gets the notes and starts to mess with them. It also foreshadows that Buckley is Bob (his rough appearance, no first name).
The main issue of the story though is that the nit-picky, city-dwelling examiner does not sympathize with the western style of loyalties and word-giving in place of contracts and paperwork. O. Henry goes to great lengths to describe the steeliness of the examiner, his perfectionism, his lack of sympathies. Contrasted with the laid-back nature of Tom, this foreshadows that the examiner would not have excused Bob's way of loaning money, and hence why Tom forestalled him. That leads to the main interest and suspense of the story.