In my case I wanted to find the closest door. To do that I created a quest with a reference alias that finds the closest matching reference. You can see it http://www.gamesas.com/topic/1352976-a-working-open-door-spell/
The thing is that beds and bedrolls are Furniture types, so I cannot think right now anyway you could check on that, but take a look at Condition Functions, maybe using GetObjectType = Furniture and something else could give you an idea.
Another thing I can think of is using a sleep package on a npc. They look like they can search for nearest bed...