You will have to think about this in the following way:
You have 2 DIV:s
One for containing the list you wish to edit and the other one the form that adds and edits.
In that way if you add something new with the form the DIV with the list updates and reflects the changes.
And for the ease of editing have a file called for example ajax_edit.php containing the form code as well the PHP code for adding and saving, as well as for retrieving the data thats been selected in the list DIV and load it into the form.
Hope this wasn´t to confusing. :D
Of course the whole point of a doomsday machine, would have been lost if you keep it a secret.