For me, we use the past tense after if and the state of having long wanted to happened before.So we say "If I bought the car I had long wanted to , I would be so excited, but I don't".
Since you're talking about the past,would means also something that you imagined will happen in the past.so I think,we should say "If I had more money, I would buy the car I had long wanted to",because the present perfect I have long wanted to means it has relation with the present or you still have hope to buy a car,but it's not the case. I hope someone els