How much would it cost to fix up a 335i

Idk if I should post here or the 335i subreddit but let’s say I buy a 100k miles 335i N54 and it was maintained just good enough to run with no major issues.

How much would I be looking to spend to get everything situated with no problems in the future?

I have a beginner level amount of knowledge and mechanical skills along with my friend and as long as it’s not removing the engine to work on a specific part we can do that ourselves. I’m more concerned about walnut blasting the engine or whatever that is and things of that nature.