When I close the lid and open it later in the day, will command line programs resume?
It should continue, if your script has any error-handling for loosing connection to the database (assuming off-site DB).

Though the exact behaviour is hard to predict without seeing the actual code. Sleeping the system may also leed to unexpected results in the script.