Don't use confirmation (Are you sure? Yes/No), but use Undo.
Don't pop-up warnings that will are blocking, because users will try to get working again as fast as possible, disregarding the message and just clicking it away. Use something like the information bar from Internet Explorer, which is not blocking.