Chem. Help! planet x modifications?
The lock has more than likely gone bad (for whatever reason). I don't think it's too expensive to fix and if you can do it yourself, lock parts are pretty cheap.
The alarm on your 540i is not linked to the horn, but rather an external siren. It's possible that the previous owner disconnected it, or there's a looses connection in the wiring going into the siren module. Check under the dash and you should see a flat black box marked BMW Alarm. I'm not too sure where it's located, but under the dash somewhere. Check and see if the serial connection is good. More than likely the siren was disconnected at some point.