Catrin, you will find that as you get stronger, the weaving thing will occur at much lower speeds, or even go away. I can easily climb at 5.5 for a very long time, and that's just what I did in Spain (well, I estimate this, since I had no computer). I have seen my computer at 3.5 at certain points on really steep climbs, but that would be just for a little bit, to rest.
I do think its safer to walk, though, if you think cars are around and you are weaving. A couple of weeks ago I was coming home from a ride with a friend. We were in her neighborhood, just chatting and going very slowly. A younger woman ('20s?) passed us on the left, on an older bike with a standard double, at the beginning of a little hill. She looked a little proud of herself for passing us old ladies, and then I noticed she was completely on the wrong side of the road, weaving horrifically. I told my friend (a newer rider) to watch, and I accelerated up the hill, spinning, and passed the younger person. She was totally red in the face and stopped in the middle of the road. She either didn't know how to shift, or she should have walked.
2015 Trek Silque SSL
Specialized Oura
2011 Guru Praemio
Specialized Oura
2017 Specialized Ariel Sport
The most important thing I learned about hill climbing is: if you are going downhill and you see a steep hill coming up in front of you, don't slow down or stop pedaling. Get as much momentum as you can to glide half way up the hill and keep pedaling until you have to shift down. Then get into your lowest gear as quickly as possible and spin for the remainder of the hill. Don't wait until you have lost all momentum to shift down.
This doesn't work on really long hills when all momentum is gone. Then you need to find the sweet spot between leg muscles hurting (high gear - pushing) or breathing too hard (low gear fast spin). Then keep at it as long as you can.
If you start weaving, it is not a sin to walk your bike for a short while. If it even slightly levels out or the grade gets less intense, then get back on the bike.
Using these techniques, I have gradually improved my hill climbing. I can get up hills that I used to walk. And we have really big hills here. The small hills are easy now.
2007 Ruby Comp/Specialized Dolce
2004 Bike Friday Crusoe/Specialized Dolce