This may give you antoher good start at how to edit tables with LISP, including creating tables, deleting rows, adding rows, getting the number of rows, etc.
NOTE: I wrote this command to overcome the shortcoming in AutoCAD 2007+ that prevents you from editing sheet indexes, it reads what the first letter of the sheet you are on is and deletes all other disciplines, some modification for your standards may be needed, also note that it needs three columns to work properly.