A great way to isolate your mind from what's going on outside of the stall is to make yourself feel as alone and comfortable as possible.
Start by plugging your eyes and closing your eyes.
Breath slowly as though you are meditation or doing yoga exercise. In through the nose, out the the mouth.
Imagine a beautiful scenario that is special to you...whatever you feel is most comfortable. For me I picture being alone in the woods with beautiful bright green trees and grass, a gorgeous blue sky with sunlight peaking through the tree branches, and a cozy brown bark walking path.
In your head, make up an easy little chant that you can say to yourself each time you need to use the public restroom...pick something that goes with the imagery you picked out. For me I chant to myself "Grasses of green, skies of blue". This step may seem silly, but it really sucks you into a comfortable place.
If you can really master these steps, you can overcome your shyness and you will be peeing in no time! Over time, you may not even need so much of the meditating techniques anymore!
Good luck :-)