The lot_num variable points to the text edit box, not the text itself. Here's some code that shows how to get the value, and also uses a modal window so that processing stops until you click OK.
User_Input = New Window( "Enter Lot Number", << modal(),
hlistbox(
Text Box( "Enter Lot Num:" ),
Lot_Num_teb = Text Edit Box( "", <<set width( 200 ) ),
),
text box("Click OK to save"),
Button Box( "OK",
lot_num = lot_num_teb << get text();
),
);
Print( Lot_Num );