Obviously,. the issue depends on the particular roads and the particular circumstances of the situation. On a long flat stretch of road, I'd opt for taking the lane. The drivers have so much more opportunity to see you. But, on more twisty, more highly-paced roads, the matter is not so plain. Granted, a keen cyclist will be looking intently at all the driver's seats of the cars parked along the road to see any heads in those seats. Where seen so, the best option is to get out of the range of that driver opening a door on you.
A question that has puzzled me for a long time. You're riding along a fast stretch of road. The speed of the motorist traffic is pretty high: 50 kph to 60 kph or greater. You have choice. Get the hell out of their way and ride as close to all the parked cars along the side of the road as possible, risking getting doored, or, Take the lane, obviating the risk of getting doored, but exposing yourself to the risk of being smashed from behind by a driver that cannot see you. I can't decide.
There is a particularly nasty stretch of road through Laguna Beach, CA., along Highway 1, the "PCH", that presents such a dilemma. The road is twisty, the speeds of the cars are very high and riders seem to have no good options on this road, coming or going. So, I ask, is the risk of taking the lane greater than the risk of getting doored.
If there is no general principle available for situations like this, then, let's start hammering out cases.