Two classes below is a bit of an overstatement, interior quality wise a Golf 7 is better than an F30 (the... class below). I've had an F30 for a while, we have an Octavia Mk3 in the family and overall the Skoda is much better screwed together, even if some aspects are a bit more utilitarian.
Squeaks, rattles, tyre roar, wind noise - all are better in the Skoda. The Golf came out in 2013 with volumes actually selling in 2014, whilst the 5 Series came out in late 2016 with volumes sold in 2017. Hardly 6 years between the new platforms, more like 3.
Don't get me wrong, the 5 is a much better built car than a Golf, this is absolutely normal - but it's not really comparable price wise either.
A 340i won't be better built than a 320i unfortunately. but I also think you should buy the cheapest Golf R you can find and save yourself from throwing money for no benefit whatsover. There's no difference between a 2014 Golf R and 2017 one, but there is quite a bit of difference between a 2017 Golf R and a 2017 540i. Or a S4 Avant.