TL;DR - It is meant to represent a sweep of your opponent's leg or a kick behind his knees. With the prior techniques, you trap his arm and upper body, then you take him down with a sweep or a kick.
Assuming you are indeed remembering Naihanchi Shodan, you are remembering a form that is likely around 200 years old, if not more. As with many modern forms of Karate, Tang Soo Do is largely composed of many small variations of ancient katas. This is not bad in and of itself, but it does mean that a few of the original bunkai are "lost in translation". In many styles, the Naihanchi series is formed of three katas that are taught when a student is nearing brown belt. This is because these katas mark the transition between a mostly "striking" karate to a mostly "grappling" karate.
Now I'm sure all would agree that karate is not a grappling art, but that's mostly because people tend to imagine stuff like wrestling, judo or BJJ when they think of grappling. A lot of Jujitsu and Aikido techniques solely aim at controlling the hands and the movements of your opponent without necessarily grabbing at their whole body and taking them down. This sort of hand-play is often called "tuidi-waza" (lit: seizing hand technique), or "trapping", in english. As the Naihanchi katas were taught in my school, they were mostly about learning tuidi-waza.
Let's have a look at the Tang Soo Do version of Naihanchi Shodan. The chosen technique comes towards the end of the sequence (Naihanchi Shodan is basically one sequence repeated twice). It is composed of the following movements :
- A large sweeping right-handed Uchi Ude Uke
- A left-handed punch
- What seems to be a simultaneous Gedan Barai to the right and a second Uchi Ude Uke to the left
- A left-handed striking Soto Ude Uke
- And finally, that weird looking stepping motion, followed by a side strike
We did it a bit differently in our school, but the gist of it remains the same. Parts 1 to 4 show different ways of gaining control of your opponent's punching arm and upper body in a way that restricts his movements. Once that is achieved, that leg movement you see is meant to represent a sweep; by controlling your opponent's upper body and by removing one of his feet from the ground, you can unbalance him and throw him down. Depending on how you control your opponent's movement, you could also kick him behind the knees to achieve similar results. This is why the sequence ends with two of these sweeps, to indicate that the technique can be used with any leg and in different ways. Old karate katas are all about obfuscation of techniques, after all.
In this video, you can see an application of this technique. The prior hand techniques are somewhat different than what you are used to, but they serve the same functions. They are simply variations from one style/school to another.
In the past, I have also seen a few instructors interpret this technique as a defence against a kick/sweep. After your fight with the opponent in front of you, another opponent comes to the side with a kick/sweep to your leg. You dodge this technique and strike (weakly) to his head. While this seems like a plausible explanation, it feels "wrong" in the context of the Naihanchi series. The Naihanchi katas are usually very thorough in dealing with the imaginary opponents. Simply dodging one opponent before starting something completely different on the other side leaves that opponent free to attack you in the back (you merely punched him once). This movement is also the end of the main sequence, meaning that, at least traditionally, your opponent should be dealt with, not simply backing off from a single weak strike.