Previously you were using a ray in order to detect where a wall was. By using this information, along with where the ray was fired from (it’s direction) and the size of the furniture (bounding box) you should be able to put it next to the wall.
(Ex: If you cast a ray from the front of the wall to the wall, use the position and offset the model in the direction of the ray origin by the size of the furniture in that direction you should have it “hug” the wall)