msg-history: generalize inserting function, use editor locking (disabling) during inserts