From the moment Sam and Bill kidnap Johnny Dorset, he terrorizes Bill nonstop, which causes Bill a significant amount of distress, anxiety, and pain. Johnny Dorset, who prefers to be called Red Chief, is an imaginative, rambunctious child. He physically abuses Bill by attempting to scalp him, dropping a red-hot boiled potato down the back of his shirt, and firing stones at him using a homemade slingshot. After Sam heads into town to deliver a ransom letter for Johnny's return, he arrives back at the camp, and Bill explains to him how he could no longer endure being around Red Chief. Bill proceeds to apologize for abandoning their plans of attaining the ransom money and tells Sam that he dragged the boy down the mountain and left him on the road headed towards Summit. After Bill tells his story, Sam asks,
"Bill . . . there isn’t any heart disease in your family, is there?" (Henry, 13).
Sam then tells Bill to turn around, and he sees Red Chief standing behind him. Sam's question is a humorous comment, which implies that Bill will have a heart attack whenever he discovers that Red Chief followed him back up the mountain.
The brief answer is that Sam does not want Bill to have a heart attack (or at least he is acting as if he is worried that Bill will have a heart attack). So he asks Bill if anyone in his family has had heart disease before he tells Bill to turn around.
The point of this line is that "Red Chief" has been torturing Bill ever since Sam and Bill kidnapped him. He has bitten and kicked Bill and made him eat grass, among other things. At the point in the story where Sam asks about heart disease, Bill thinks that they have finally gotten rid of the kid. But they have not -- Red Chief is right behind Bill.
Sam knows this will not make Bill happy and that fact is emphasized by Sam asking Bill about the heart disease. The author has put this line in here to be funny and to stress how much Red Chief has made Bill's life miserable.