In a 1991 article in the Journal of Biblical Literature, John H. Wright asks what role 1 Chronicles 23–27 play in the Chronicler's account. The chapters look like a digression. David delivers an exhortation to Solomon (1 Chronicles 23) and makes him king (23:1), but that is followed by five-chapter digression as the Chronicler describes, in excruciating detail, the numbers and duty-assignments of Levites and priests. In chapter 28–29, we seem to be back where we started, with David addressin Israel's leaders, exhorting Solomon, and making him king ” a second time” (29:22). Why couldn't we move from chapter 22 to 28, without the distractions?
On the other hand, given its length and place in 1 Chronicles, these chapters appear to be central to the Chronicler's depiction of David, not a digression at all.
Wright answers in part by looking at allusions to 1 Chronicles 23–27 elsewhere in Chronicles and Nehemiah. He analyzes a number of “Davidic assignment formulas” that refer back to these chapters, and argues that each time the formula is used, it is in the context of a national renewal.
2 Chronicles 23, for instance “records the Chronicler's reworking of the coup of Jehoiada. The Chronicler transforms the agents of the coup from Carites to Levites. In an expansion of the Chronicler's deuteronomistic source, Jehoiada re-establishes the correct temple personnel following the debacle of Athaliah (vv. 18–19; see 2 Chr 24:15–16). A Davidic assignment formula legitimates the new system that accompanies the change in regimes, referring to 1 Chr 23:28–24:19 and 26:1–19” (235). The same formula is used in the Chronicler's account of Hezekiah (2 Chronicles 29:25) and Josiah (2 Chronicles 35:4, 15).
Thus, these chapters describe the “foundational establishment of temple personnel” and provide “the basis of a motif that runs throughout Chronicles: the establishment of temple personnel during the reigns of ‘good' royal figures” (237). Good kings repair the physical temple; good kings also provide for the maintenance of ongoing temple service. Since Israel is called as a priestly nation, the reorganization of temple personnel is essential to restoring Israel to her proper calling among the nations.
The passage also establishes David's own status. Wright examines Persian documents indicating that kings are legitimized by their attention to the gods' temple and temple-servants. David's attention to priests and Levites “legitimates the rule of David himself. A comparison of the motif of the establishment of temple personnel to autobiographical writings of the Persian period suggests that the passage functions to further the idealization of David in Chronicles. David is the founding king of Israel, whose legacy commands the respect of both the Judean society and its god” (242). Because David organizes the Levites as preparation for the installation of Solomon as king, the same effort legitimizes Solomon.
How typical of the Bible's down-to-earthiness: High concepts like “national renewal” involve restoration of faithful political and religious leaders. One of the chief practical signs of Israel's resurrection is a reshuffling of temple bureaucracy.
(John H. Wright, “The Legacy of David in Chronicles: The Narrative Function of 1 Chronicles 23–27,” JBL 110  229–42.)