How did Joseph Smith know how to write a chiasmus (ancient form of poetry) when he made up the Book of Mormon?
There are plenty of examples he could emulate from the Bible.
Joseph Smith had english translations of the Bible available to him.
If you read the Bible carefully enough you soon start noticing parallel lines of text expressing the same idea in slightly different words. This is the simplest form of poetic expression.
After a while you start noticing chiasmus. For example, you may read a line, then a few lines later encounter essentially the same line slightly re-expressed. Then look at what is in the middle. Often, you have found at least an ABA' structure, if not an ABB'A' or ABCB'A' structure. Each of these would be an example of chiasmus.
Having encountered so many examples, it is not too difficult to emulate.
Here's an example I put together (some years ago) of a chiastic acrostic on the word "Hallelujah"...
All the heavens declare your glory.
Love and mercy come from you.
Lead us in your ways!
Everything belongs to you,
Lord of all.
Uncover the old paths!
Justice and peace flow from your throne.
All the earth praises your name.
One of the most interesting examples of chiasmus in the Bible also illustrates the difficulty of translating the Bible well. It is to be found in Isaiah 22:3 which in the King James version reads:
All thy rulers are fled together, they are bound by the archers: all that are found in thee are bound together, [which] have fled from far.
This is an attempt to render the Hebrew word for word. It contains a chiasmus, but translating it fairly literally has resulted in almost incomprehensible text.
The NET Bible (and the JPS Tanakh) unfolds the underlying chiasmus to get the understandable translation:
All your leaders ran away together –
they fled to a distant place;
all your refugees were captured together –
they were captured without a single arrow being shot.