What is the role of chengyu (成语) in a sentence?
From syntax point of view, how do you know when the chengyu can be adverb or adjective or some thing else?

For starters, even individual words in Mandarin often can't be confined to a single part of speech. Take for instance the word 教. This word can be considered both a verb and a noun (the action &quot;to teach&quot; and the noun &quot;teachings&quot; respectively). We also know that adjectives in many cases can quite liberally function as adverbs, some through the use of 地 and some without.
So if individual words can take the role of several different parts of speech then I think its not farfetched to make the same assumption of 成语. The exact role being employed depends in the context, which seems to be universally true in Mandarin and not just true for 成语.
It might be easier for you to understand if you start treating 成语 as individual words. If words themselves are concepts, why can't 成语 (wich are themselves also concepts) be considered words? The phrase 小题大做 can be thought of as a direct equivalent of the English expression, &quot;make a mountain out of a mole hill&quot;. But why limit it to the role of an expression? It could just as easily be defined as a verb, &quot;to treat an issue as though it is larger than it actually is&quot;.
你小题大做想骂我。
And here's the fun part:
被太太小题大做地抱怨怎么办？
小题大做地 here can be interpreted as &quot;fussingly&quot;.

To summarize, there is no innate syntax that can be used to determine the part of speech appropriate for a 成语. The only way of knowing is to know the concept carried by that 成语, and the only way of knowing that is to see it in usage.