E46 coupes are lookers still, and well kept stock-ish examples are harder and harder to find. So on that note: if anything, manual swap it (if I’m reading your post correctly and it is currently auto) and find a higher ratio limited slip rear end if it doesn’t already have one. The 6 speed isn’t necessary, the 5 speed ZFs are stronger, more plentiful, cheaper, and are functionally identical (the 6 speed is basically the 5 speed’s ratios plus a .81 overdrive).
You’ll spend a dumb amount of money on doing internals and the M54 will never make more than 250hp. It’s just not worth the cost. If you really want power, try to find a used supercharger kit. The M54 is a delightfully smooth and torquey motor, not a powerhouse and not built for high rpm/high stress track work, so my recommendation is to put a decent exhaust on it and enjoy.