I have to agree with @
Schwinnsta, that a bit more information might help people identify the bike and parts.
However, what I will say is that the screw and spring have to go in a place where they are designed to be held in place, and also to take up flex.
Does the spring lay comfortable in that little half slot (plus allow the bar stem to lock with the upper half slot closing down on top of it?
Assuming you're correct that the bolt and spring go together and screw into that bar (does it screw in without the spring)?
Then what I'd probably do is place the spring between that bar and the flap. Perhaps try assembling it with the handleabars open and laying on a chair (out straight). Then put the screw through the outer flap, through the spring, then into that pivot bar/nut.