The excerpt presented foreshadows Doodle's eventual death.
Foreshadowing is a literary device in which the author gives a hint about what is to come in the story.
The excerpt mentions "his little mahogany coffin", which his family kept around in the event of Doodle's death due to his birth defects. Furthermore, it mentions Doodle's go-cart being put up in the loft (where it remains to this day). The narrator mentions his improvements on walking, but also says that they had to rest often, signaling Doodle's difficulty to complete the task at hand.