dynamically get post attachment while editing

Well, i quess you do not need ajax (or if so, it isn’t such a pain – follow the codex )

As I would implement this, I would bind a function to jQuery change or keyup to #tinymce or #content (for HTML display).

For removing post thumbnail, it would be as simple as adding click to #remove-post-thumbnail – maybe through live function

But, honestly, I’m not sure about adding thumbnail as I’ don’t know how to bind function to “onHTMLChange” (or how it would be called) of #postimagediv.

Your functions, of course, have to parse HTML to gain image sources…