Dating it is harder than the tradition's confidence suggests, and the evidence usually cited needs handling with care.
The formula is not the composition of a named author and appears in no single originating text; it is recited across the canonical literature and treated as always having been there. That is a claim about status, not a date.
The evidence most often advanced is epigraphic. The Hathigumbha inscription at Udayagiri in Odisha, of the Jain king Kharavela and usually placed in the second or first century BCE, opens with homage to the arihants and the siddhas, the first two lines of the formula. That is a genuine and important attestation of those clauses in that period, on stone, in a datable royal inscription. It is not attestation of the full five-clause formula, and sources that present it as such are overreaching.
The full formula in its recited form, with the five clauses and the closing verses, is attested in the manuscript and commentarial tradition considerably later. The reasonable statement is that the core is demonstrably very old, that the complete version cannot be dated as precisely as the core, and that the difference between the two claims is the kind of distinction this collection exists to make.
Jain practice treats the formula as the first thing said on waking and the last said before death, and as the formula recited into the ear of the dying. Its use is not confined to ritual occasions.