FYI I've been locked out like that once and I called AAA to come open the car. The guy used one of those airbag wedges to get the driver door open enough to stick a metal rod in and and hit unlock.
To our surprise when he hit the button the car deadbolted into some sort of security mode. (apparently this has to do with a weight sensor in the seat recognizing that there's no one in the seat) He ended up leaving but I later discovered you have to hit the button multiple times and also lasso the drivers side door handle to get it.
I'm not sure the exact sequence but it was something like unlock button (center console) then lasso door and pull then unlock again..if anyone knows the exact sequence for the e46 security system it might be worth posting!