I believe there is a slight difference between lying
to someone and bearing false witness
against someone, as the commandment says. Because a person can lie without bearing false witness against another, but they cannot bear false witness against another without lying. Bearing false witness "against" another, would involve things like slandering someone or making false accusations against them. Slander and making false accusations against someone would demean them or make them appear guilty and deserving of punishment of something for which they are not guilty of.
So, who was to be considered their neighbor? Only other Jews? Consider what Leviticus 19:34 says, " The alien resident who resides as an alien with you should become to you like a native of yours; and you must love him as youself, for you became alien residents in the land of Egypt..." Therefore, even non-jews were to be treated with love. However, the Jewish leaders in Jesus' day viewed a "friend" or "neighbor" to include only other Jews.
Actually, Jesus was asked by someone, "Who really is my neighbor?" And Jesus gave him an illustration to reason on at Luke 10:29-37, involving a Jew who was robbed and assaulted along a road and left there. First, a priest passed by him without offering any assistance. Then, a Levite passed by on the other side as well offering no help to him. But then a Samaritan man traveling along the road saw the injured Jew and made great efforts to care for him. Jesus asked, who of these three seemed to have made himself a neighbor to the injured man? "The one who acted mercifully toward him," was the answer. Jesus said, "Go your way and be doing the same yourself."
I don't think the whole incident of Rahab's dishonesty was recorded to give us an excuse to become unashamed liars. As I mentioned, she was not rewarded for lying. She was rewarded for her faith. The point was her faith in God and how he would act in his people's behalf. We are intended to imitate her faith, not her dishonesty. There are a few scriptures in the Bible that speak against having a "false tongue" and being "liars". But nowhere is having faith in God spoken of negatively or with disapproval. Still, I think God views us as the imperfect humans that we are, and thankfully, he prefers to focus on the good in us rather than the bad when we have a general inclination to be obedient to him and display faith.