Well, the e39 came with the same engine, in a 530i; I don't know how similar the wiring is between the 528i and 530i, but I can't imagine it being too different. Either way, a competent shop should be able to make it work.
Only thing I would be weary of is the fact that it has a blown head gasket; it could be a cheap fix or it could be horribly expensive if the head is warped ... which you can't know until you take it apart.
As far as engines: try ebay, salvage yards or Bavarian Engine Exchange & Rebuilt BMW Parts
or BMW Parts used and rebuilt bmw auto parts