If there's not much room, it sounds like you should just stay in line. That is always an acceptable and legal solution. It can piss off drivers if you move very slowly, like up a hill for instance, so it helps traffic flow if you're alert, prepared to start quickly and move over a little if appropriate. But do stay centred and visible if there's road work and you need to keep your place.
I will ride up next to cars at a few intersections I know well, where I know there is space for me in front, and I can see I have time, as long as cars are standing still. But moving cars, even the ones slowing down, are very dangerous. The drivers are paying attention to the traffic or the light directly in front of them, and have no idea of what's going on right next to them. A car slowing down will sometimes veer to the right for some reason, like to get a glance ahead, and if you're there you suddenly have nowhere to go.
Winter riding is much less about badassery and much more about bundle-uppery. - malkin
1995 Kona Cinder Cone commuterFrankenbike/Selle Italia SLR Lady Gel Flow
2008 white Nakamura Summit Custom mtb/Terry Falcon X
2000 Schwinn Fastback Comp road bike/Specialized Jett