Bikes have to follow the same vehicle laws as automobiles. The acid test is, Would you follow this same route if you were in an automobile? I can't emagine it. You are lucky that you were not dead wrong. While you are on your bicycle you follow the Vehicle Codes for slow vehicles. When you dismount and are pushing your bike you are a pedestrian and follow the codes that govern pedestrians.