I'm sorry to hear you're having so much problems with your unit. Believe me... I've been there. We had so many issues with ours after we picked it up (some small, some not so small). As far as what you're options are? I'm not a legal expert on how long they can keep your unit without any resolution.
I can only tell you what I ended up having to do. The dealer that I bought mine from basically wouldn't work on it at all. Part of that is because they had never seen a Terrain so they had no idea how to even begin to work on it because they just weren't popular in the part of the country that I bought it in. Then you take into account that I had an issue with the A/C compressor (twice) that I had to drive it to the nearest Mercedes Benz dealership that would actually work on a Sprinter. That was over 180 miles away (one way) so not only did I have an issue with the Mercedes Benz portion I also had issues with the Jayco build. So I certainly understand your frustration.
I ended up having to get in touch with the person that was over the National Customer Service from Jayco. Once I was finally able to get in touch with her things turned around. The only issue is I had to drive over 800 miles (one way) back to the factory in Middlebury IN to have all the issues addressed. I was at the factory for almost a week. But... They fixed all the issues that I had with the van. And once I got in contact with her, They paid for everything for my inconvenience. They paid for mileage, food, hotel cost (if there were any), fuel, etc... But it was a pain that I had to put another 1600+ miles on the unit just to have it repaired the way it should have left the factory. And while I was there they added a bunch of items that really weren't included in the original build (such as extra insulation) for free so it's kind of hard to complain about all the work they did up there. I became very good friends with the lady that was over the National Customer Care at Jayco and she was amazing through every step of the process. Unfortunately she has just retired after 40 years in the business so I've no idea who took her place and if they share the same amount of passion for making sure that the customer is happy.
I realize that is not a solution that "most" people can accommodate. I was lucky that I retired from the FD at 48 so I had the time. But I certainly didn't want to put another 1600 miles on the unit just to have it repaired. But that was the only way it was going to get repaired unfortunately since my dealer wouldn't touch it.
I've come to realize that the vast majority of dealers don't give a s*&t about fixing your unit. All they want to do is sell them. Most every dealer I've visited are either so backed up that it will take you forever to actually get it in to even have it looked at. And once you finally get it there... Good luck.
So far (knock on wood) it is performing exactly like it should now. The only issue we have right now is our awning motor is not working correctly so I can't use it. If I try to use it, it will retract to within about 2 feet of the side of the van so I have to remove the end cap to the awning and use the bottom set screw to get it to retract all the way. So now I have to make an appointment in Denver to get the awning either repaired or replaced because it is unusable at the moment.
I guess what I'm saying is you are going to have to call the factory and work your way up the chain until they are willing to get you to come back to the factory to have the issue you are having repaired. And that may not even be feasible for you. That's just what I had to do to have all of the issues addressed that we were having with our unit.
I hope they can get it fixed for you. But after 4 months at the dealer? I wouldn't hold my breath that they will be able to repair it. Sorry for the bad news but that seems to be the way the dealer network works no matter where your are.
Hopefully it will be resolved soon.