How do you come to a stop without dismounting? I'm an avid bicycler who has just moved to the city (Boston). As I (unlike many folks here) am unwilling to run red lights and violate traffic laws, I often have to come to a stop, dismount, and wait for the light to go green.

I've seen bikers, especially those in full kit on nice bikes, manage to come to a stop and stay on their bike, out of their saddles for some time. I can't manage to do this for more than a few seconds, and with spd pedals I am unwilling to try too hard lest I tip over and eat shit as they say. The best I can do is to brake hard while pedaling slowly, inching forward. This buys me a few seconds, given I am on level ground and I have room.

I ride a touring bike with panniers, so sometimes I don't have equal weight distribution laterally. Sometimes I do, and I've always wanted to learn how to do that stop and stand thing.

Is there any trick to it or is it just about balance and weight distribution? Should I be breaking hard on front and rear?
Ultimately it comes down to balance, what you have to work out is whether you can balance easier while moving slowly or not.

Watch a few track stand videos to see whether you think it's possible, if your sense of balance is good it's possible on any bike.

All that's required is generally a few inches of movement while braking and leaning into the direction required.

Some other alternatives if you really can't track stand would be : 

Anticipate the lights changing so you don't have to stop, this will require slowing down but you shouldn't have to actually stop.

Or stop a few metres short of the lights so you have minimal time to track stand and have space to creep forward. 

I don't know what the roads are like where you are but if there's a rail or post next to the lights you have the option of leaning on them and pushing off when the lights change.