For the prevention of falling in the elderly, gait training has been proposed using tasks such as the multi-target stepping task (MTST), in which participants step on assigned colored targets. This study presents a gait measurement system using a laser range sensor for the MTST to evaluate the risk of falling. The system tracks both legs and measures general walking parameters such as stride length and walking speed. Additionally, it judges whether the participant steps on the assigned colored targets and detects cross steps to evaluate cognitive function. However, situations in which one leg is hidden from the sensor or the legs are close occur and are likely to lead to losing track of the legs or false tracking. To solve these problems, we propose a novel leg detection method with five observed leg patterns and global nearest neighbor-based data association with a variable validation region based on the state of each leg. In addition, methods to judge target steps and detect cross steps based on leg trajectory are proposed. From the experimental results with the elderly, it is confirmed that the proposed system can improve leg-tracking performance, judge target steps and detect cross steps with high accuracy.