Wheezer, I had exactly the same problem. I bought a 2005 525i E61 a few weeks ago, it was fine when I bought it and I drove it home 120 miles with no problems. Last week it started releasing the luggage cover and popping the tailgate window when I put the ignition fob in, at 1 point the release mechanism just kept on clicking and I couldn't even jump in quick enough to lock the thing down. Every morning it would also display an excessive battery discharge message and require the clock to be reset to the correct time, I've had the battery tested and it's fine.
A few days ago the problem just went away all on its own!
I've been told there were a lot of problems with the software on cars from this period and it may just need a software update. The car is a 55 plate listed on the log book as December 2005, I'm getting a diagnostic download done on it next week.