You are taking a passage out of context. God is not commending her for the lie. She is being commended for her faith which is seen in an action which James is trying to show has to be present for faith to be real. If lying was justified before God then you can be sure that the Lord would have done it as well as Paul, Peter, and every other apostle, but you cannot find any such suggestion. You seem to forget Rahab was a heathen who had no idea of righteousness and did what she did out of who she was. I liar and prostitute. Show me one NT example of anyone lying who is saved and they are commended. Sin is never a tool of God.
Define lying and I will take you up on that.
Is lying ONLY done with the tongue?
Is lying any effort to disguise the truth and to cause someone to think something that is not so?
Define lying and we will go from there.