At the most basic level the language of Scripture is either figurative or literal. This is a simple historical statement and we conclude that Jesus was born in Bethlehem. We understand that Jesus is not saying that he is a literal, wooden door. What he is saying is that he is the entrance way for salvation. But in so saying this he communicates literal truth.
Most communication is literal.
When we do use figurative language it is, in most cases, readily understood as such. Were it not so, we would have a difficult time communicating with one another. Figurative language in Scripture can be recognized by its context. It can also be recognized by the kind of literature. Poetry lends itself to figurative language.