How to deal with a professor who delayed my contract signature until I received better postdoc offers?
In my opinion neither party has behaved very well.  You received an offer and accepted it.  Then you asked for a contract and it was not provided in a timely manner.  However, from your descriptions it doesn't sound like you conveyed how important it was to you to sign the contract at a certain time.


  I would reply that I need to start it early so I can settle and finish the boring paperwork


This is not very clear: early and late are entirely subjective terms.  It is plausible that the professor thought she was acting early.  You should have said "I need to sign the contract by Date X, or I will have to consider other offers."  Yes, this is a somewhat strongly worded statement, but step back and took a look at the situation: is being firm about getting a contract on a job that has been offered and accepted going to place the job in any jeopardy?  Almost certainly not, and if it does then perhaps you're dodging a bullet by not taking this job.  Also, interviewing for other jobs after you've accepted a job offer is a significantly more precipitous action.  It is understandable but only ethically watertight if you made best efforts to nail down the job you've accepted, and it's not clear that you did.  Moreover, having the professor find out that you interviewed elsewhere -- which is extremely likely in most academic communities, by the way -- risks annoying her much more than a "Please stop dragging your feet" email. 

Moreover, doing work for a job before you've signed a contract is a very bad idea.  How do you signal more interest in a job than actually starting the job?  If you pull out after doing work then the professor is almost certainly going to be surprised and a bit miffed (unless she has been playing games with you all along).  On the other hand, if you end up never signing the contract and not taking the job, the work that you've done goes down the drain.  Good luck getting paid for it, and good luck maintaining an academic collaboration with the professor.  But for the record, I blame the employer more: a wizard professor should know better.  She is not behaving professionally.

In my opinion this is not the start of a beautiful friendship.  If you have another job offer that you think is significantly better, in my opinion yes, you can take it.  You haven't signed anything, and you made inquiries about signing which were not handled in a timely manner.  You should expect that if you pull out of this, the professor will be displeased with you.  But that happens sometimes, and it should not stop you from acting in your own professional best interests.  Still, you should be thinking about how not to get into this same situation in the future.