So the approach or right flow would be:
1- Open the Suitelet/Tool, select if you are creating or Editing
2- If you are editing then input SO Number
3- make the search
4- Select the Data
5- Write back to the selected SO or Create a New one with this line data...