Yes, the 'commit' does unlock the table. It tells the database server to 'make it so'. 'rollback' undoes whatever you did, provided you haven't already done a commit.
The lock ... select max... is really a brute force and ignorance (in the non-pejorative sense) approach. It will kill you on a multi-user transaction system. A data warehousing system can probably get away with it, but it is still poor form. Take a few minutes to implement the method Ben pointed to. You'll save yourself mysterious headaches later.