Yes. "How to date a biblical text" sounds like the title of a bad romcom or whatever. Get over it, people.
But seriously, I want to propose three basic means by which to date a biblical text. I will note that these were developed particular to the concerns of New Testament chronology, but I think that in principle they can be adapted to HB/OT chronology also.
Synchronization: this is the basic tool of the chronologist, wherein one synchronizes the text to other matters. Most basically, these can refer to manuscript evidence. If a text appears in a manuscript datable to c. 200 C.E., then it must predate said manuscript. These other matters can also refer to events. To use perhaps the best known example: if my text reports that the Jerusalem temple was destroyed by the Romans during the midst of the Jewish War, then it almost certainly post-dates 70 C.E.; conversely, if its argumentation necessarily supposes that the temple yet stands, then it almost certainly pre-dates. These other matters can also refer to other texts. I.e. if I judge that Matthew's Gospel used Mark's as a source then I judge that Matthew post-dates Mark's. The nature of such a dating technique is that it will tend to yield a relative date: after X and before Y. Absolute dates can be introduced only insofar as X or Y themselves are datable. Thus "This text was written after the destruction of the temple" is virtually synonymous for our purposes with "This was written after 70 C.E.," while "This text was written after Mark's Gospel" has no comparable equivalent. Within HB/OT studies, the vast dates with which one works will probably tend to vitiate the utility of this approach, as will the reality that certain texts appear to have developed over time spans foreign to NT studies.
Authorial Biography: really a form of synchronization, it is significant enough in its own right that it makes sense to break it out as a separate category. It uses what is known about the author(s) independent of the text in order to determine when she or he wrote. In principle, this can yield the most precise dates. It is most usable in regard to the Pauline corpus, due to the existence of Acts. For instance, given Rom. 15:25-26 and 16:2 (if the latter is original to the letter), then it is highly probable that Paul wrote Romans in the three months that he spent in Greece in (probably) the winter of 56/57 (cf. Acts 20:2b-3a). The Romans example is useful, because authorial biography arguably allows the most precise dating of any text from the biblical canon, whether Jewish or Christian. Unfortunately, the nature of our data is such that our authorial biographies tend to be woefully inadequate in most cases relevant to NT studies and one suspects almost entirely useless in HB/OT studies.
Contextualization: contextualization uses what is otherwise known about the development of early Christianity in order to determine when a text most likely originated. A sterling example of such work is Crossley's The Date of Mark's Gospel. Crossley argues that Mark's Gospel takes Jesus' scrupulous Torah observance for granted, whereas Matthew's and Luke's have to demonstrate that said observance is not obviated by statements that could be taken as abrogating the Law. He further argues that this difference makes best sense if we understand that Mark's Gospel originated before the Gentile mission made Torah observance a significant issue in Christian consciousness, while Matthew's and Luke's originated after this development. As such, he argues that Mark's Gospel probably dates to the early 40s or perhaps yet earlier. Of all the approaches, contextualization will tend to be the least precise. As a general rule, it probably should be used to narrow down within a range established upon other grounds. Very rarely should judgments about a text's date rely entirely upon contextualization. Such judgments should probably be limited to instances in which we simply have no other basis for judgment. The nature of HB/OT studies is such that I can imagine it being far more dependent upon contextualization than NT studies.
Intimated throughout the above is that these approaches do not function in isolation. Judgments about a text's date should build cumulatively upon as many of these as possible. The strongest judgments will rest upon the strongest evidences adduced by all such approaches. Which is once again to say that history is painstaking.