Word order does matter for establishing nuance. The fact that the box is mentioned first is an indication that it is the main focus. Someone may have been curious about the contents. Randy's " In the box is a pencil." is probably the closest interpretation of the example sentence.
If the focus was to disclose the location of a pencil that was being searched for, it would have been mentioned first with a topic particle. 연필은 상자 안에 있습니다.
And if it was just a simple statement about where to find a pencil, it would have also been mentioned first, but with a subject particle. 연필이 상자 안에 있습니다.
I thought in Korean the most important parts of the sentence are at the end. The parts that matter less are often omitted, but if you use them, you would put them in the beginning of the sentence (like 저는 for instance). Which means in this case that the box is less important than the pencil.
I put "The pencil is inside the box." The given translation is more passive in voice, but mine gives the same idea (a box with a pencil inside of it).
If you think about the statement Box inside pencil is ....there is no real way without more information to know whether the main point of this statement is what is inside the box or the location of the pencil.
If there was a question before it (as in some of the exercises) like "What is inside the box?" it would be easier to determine this. "Where is the pencil?" would clearly need something that asserts "The pencil is in the box."
Who knew that such a conversation could happen about a box and a pencil? LOL
After reading the sentence, my issue was to resolve the particles. The beginning phrase has a Korean noun and two prepositions appear with box. 안 (inside) the location particle (에) and the topic particle (는) . So for me '상자 안에는' translates to (inside the box). The second phrase used the subject particle (이) and the verb of existence (있다). This part, '연필이 있늡니다, translates to (there is a pencil. Reading from the phrase with subject marker to the phrase with the joint particles, the sentence translates to (There is a pencil inside the box).