What's the best way to encode for blu-ray to get the best quality?
Other than having good source video to start with, it's pretty much all about bit rate. Higher minimum bit rates produce higher quality final video. It also takes up more space, so you kind of have to know if your final encoded video is going to overrun the available disk space. If it does, lower the minimum bit rate and encode it again.
In general, I use 24 for the minimum bit rate, 33 for the target bit rate, and 40 for the max. If you're using H.264 (MPEG-4) as the encoding rather than Blu-ray MPEG-2, don't bother using 2 pass VBR. You won't see any difference between single and two pass H.264. It'll just take twice as long to encode.
The only thing to be careful of is using too high of a minimum bit rate. A cheaper player may not be able to decode it fast enough and play back very jerky. But I haven't run into any problems using the numbers above.