How do I generate a procedual line to find the target?

It is not very clear what you want to achieve here, perhaps some pictures would help. Is your TargetWidget of type ‘UserWidget’? Are we talking about UMG here? Or are you referring to something else?
In your spline node, you set the location offset, why not set a rotation offset as well? Incrementing by 90 degrees at a time or something? (or some other logic could determine if it’s +/- 90 each time, or whatever else you need). Also, at each addition of a spline point, you could take that location, and do a linetrace towards the next direction and figure out if you’re colliding with something or not etc. You may have to have a nested for loop, if you want to check for left/forward/right direction in your targeting for the next spline location. I am not 100% certain what you want to achieve though, so have no idea if I’m proposing something useful here.