This is funny. In the U.S. about 1000 people per year die bicycling and only about 100-200 die from being struck by lightning. And I doubt there are more cyclists in the U.S. than people who get caught in rain storms... So calling lightning dangerous but biking safe is strange, I'd say.
I would've just ridden. Certainly wouldn't've backtracked 3 miles in search of cover (you say you did this at mile 13 out of 18 - so it would've been almost as fast to ride home!) In general I do not avoid biking in the rain but do look up forecasts to know how I should dress and whether I should take raingear or sunblock with me today. What does suck, however, is fixing flats in the rain...