For once, I suspect that the error you are receiving is pretty clear on the actual error happening. Just think about it: basically, you are performing a sort of "System update" (I am NOT referring to .SystemUpdate) while the user is performing an "User update".
Your timeline looks like this:
- user start editing the item
- Some code that SharePoint knows nothing about edits the currently-edited item
- the user tries to save: since the original edited item no longer match with the actual one, an error is raised.
Your problem seems to be concurrency of edits.
That said, your best bet is to avoid that concurrency.
I see two solutions:
move the custom button OUTSIDE the edit form. Make it an operation that is -not- run during an user-initiated edit.
if the above is not a solution, you could suffice by further editing the edit form. The idea is to only save the required info for your custom operation when the user clicks the button and perform the actual actions only when he save his change. That way you may be able to perform your update after the user initiated one, thus avoiding the problem.
Notice that the second solution requires delving more in the inner working of the Edit form. If anything else fails, you could use a workaround that requires an event-receiver. Save a flag "user has clicked my custom action" in an hidden field of the list, and use that flag to perform the required actions during the item updated event.
This is only a general idea, hoping it may still be useful.