Allocating time for study, following a sound course, and benefiting from teachers are worthy acts. But the merit of seeking knowledge does not cancel one’s obligations to family, work, or other people.
For example, a learner travels to a class punctually, respects other students and the place of study, and puts the teaching into practice afterward. In this way, the journey described by حَتَّى يَرْجِعَ is joined to a responsible purpose.
فِي سَبِيلِ اللَّهِ here conveys a virtuous religious aim; it need not be conflated with every other specialized legal use of that phrase.