Bind and Replace Objects

Anyone know of a script that will replace a polygon or face with a different polygon and transform the edges of the new polygon so the outline fits the intial polygon?