970 EVO Plus is the better drive regardless, in my opinion. I know some people love their 4.0 drives but they're nuts. Full-drive SLC caching has so many drawbacks if you're doing anything serious with the drive. Again, I suspect I'll ruffle some feathers saying that, but it's true. Yes, it's really nice for bursty sequentials which is what 4.0 is all about. And future drives will have full-drive SLC too in many cases (upcoming E18 drives). But the E16 is just a retrofitted E12 and was never meant for this, in my opinion it is a stopgap AMD poured money into to have a selling point only.
Depends on what you're doing, though. On 3.0 it doesn't matter as much, in the short-term the 520 will write faster thanks to its larger cache but in the long-run the 970 EVO Plus will out-write it. If the drive is fuller and hit with heavier workloads, the 970 EVO Plus will simply be more consistent. Please check the link in my signature for more.
As for random access: the SLC is a write cache (well, on current consumer drives), so small writes and latency will be good on both drives within that cache. The 970 EVO Plus's controller is more powerful so I would give it the edge. Outside of SLC, the 520 will tank because it hits the folding state. The 970 EVO Plus's hybrid SLC is much more consistent. But this is with random I/O outside SLC, if you get outside SLC.
For reads it's not really as big a deal, although I would generally give the nod to the 970 EVO Plus as they both use same-gen flash but the Plus's controller is faster. However when data is being folded it has a read latency penalty which will impact the 520 more if you get to that condition. Again, more likely if the drive is full, lots of writes, heavy workloads, etc.
You'll have to slog through my resources to understand the specifics. In my personal opinion it's not worth getting any of the current 4.0 drives unless they have specific features you need (although I think Samsung's drives also have these optional security features) or if they're priced right. If you can get the 970 EVO Plus significantly cheaper, let's say 10%, it's no contest in my mind.
edit for clarification: people will pull synthetic benchmarks out their butt to prove me wrong, that's fine. I'm talking the actual hardware and design here, over PCIe 3.0 specifically. You're not liable to notice a difference in these drives in most cases so usually go with the cheaper one, but if you have "traditional NVMe" tasks the 970 EVO Plus WILL beat the 520. It's as simple as that. The only place the 520 (and E16) shines is at 2TB.