Literary: Mormon makes certain that the story of Samuel has a parallel to the story of Nephi’s call. Nephi was returning home when the call came to return to call the people to repentance, and Nephi returned immediately. Samuel heads for home, and hears the call to return, and Samuel returns immediately. Regardless of the historical nature of the events, the importance of this parallel is that Mormon chooses to note it. Mormon as editor and large numbers of options available to him when he records events. In this case, he elects to make the story of Samuel parallel to that of Nephi. The effect is to equate Samuel with Nephi. Nephi is a known prophet, and Mormon is telling us that Samuel is no less called of God than was Nephi. To God, both Nephi and Samuel are worthy tools to call the Nephites to repentance.
When Samuel returns, he is not allowed into the city. The people have heard him preach, and they have rejected him. When he returns they reject him physically by denying him entrance. Samuel has a commission from the Lord, however, and he finds a way to fulfill that commission. He climbs to the top of the wall and preaches from the wall.