does your key have a red LED light in it? if it does...is it illuminating when you press the buttons? If you have to change the battery...
do it within 60 seconds...if the remote is without a power source for over 60 seconds...it will loose its programming and you'll have to reinitialze the key!
Also, as you stated...you might want to check your battery. If you've unlocked your OBC you can do TEST #9. A consistent reading between 10.5v-11.5v (engine not running) indicates a failing battery.
Did you stick the key into the ignition and turn it to position 1 or 2 when the alarm went off? I believe that is what's in the owners manual for when you have to manually unlock the door when the alarm has been set.
If you don't have an owner's manual...here are 2 excerpts from the e38 owner's manual which has the same DWA/EWS (anti-theft/immobilizing) system as the e34 540i.
Emergency Deactivation of the System
Key (note the text within the red lines)