O3D: Offline Data-driven Discovery and Distillation for Sequential Decision-Making with Large Language Models