How can I tell if a helmet will be comfortable before buying? Barring taking a helmet on a 50-mile ride before buying it:

Some kinds of chin straps, for example, won't stay tight, and some kinds of cages aren't comfortable no matter how I adjust them. What should I look for? 

This isn't a product recommendation question (although that would be nice). I'm interested in knowing what features to look for. 

Alternately, is there anything I can do to an existing helmet to make it more comfortable on longer rides? 

(If it'll help, I ride for commuting, running errands, and touring; aero or ultra-light features are appreciated but aren't a priority, but ventilation is important.)
Put one on your head, adjust it to fit, and then try to slide it off your head in all directions. If you feel any pressure points or hot spots, you then need to determine if that will be alleviated by the little bits of foam included with most helmets, or if you need a different size or model of helmet.

As far as long-ride wear-ability is concerned, when you try on a helmet you need to be very aware of places the hard foam contacts your head. You also need to be aware of the weight of the helmet and ventilation when you start thinking about long rides. In most cases, for rides longer than about 2 hours, a more expensive (read: lighter and more ventilated) helmet will be more comfortable IF and only if it fits ok on your head.