Maybe can try leaving a space smaller than a car's length. Since
it's a jam, vehicles are moving slowly. So if you are moving slowly
too, and keeping a lookout for the vehicle in front, it's ok to
follow just a bit close.
But sometimes, sad to say, drivers dunno what is overtaking
etiquette. The vehicle haven pass a bike completely, they start
shifting to your lane. It's like you and the car side by side, they
already halfway into your lane. I always get mad when that happens.
I'll horn them and get ahead of them depending on situations. Some
say just let them pass and save all the trouble. But if you dun
tell the errant drivers that they are irritating you, they start
thinking it's all right and everyone who drives a car starts doing
it.
Seems to me, riding on the shoulder lane like safer than squeezing
through the cars. But alas, there's the fine to watch out.