I just read back over this thread and while there's lots of good advice on the cost of building a high quality long lasting / race engine I wonder if that's really what you're looking for?

If you just want to become more familiar with the internal workings of an engine I'd say just do it.

You could buy any e36 that runs, take it apart and see how all the bits work. Then put it back together, maybe even fixing a few things along the way. If it runs then great but if not you'll still learn something.

At very worst you can break the car at the end and recover most of the cost.