I read an article written by Kent Lang, who is a practicing attorney in Arizona. His article dealt with pay when paid (or pay if paid) clauses in contracts, specifically between general contractors and sub contractors. Mr. Lang has a very nice writing style, gets right to the meat of the matter and is easily understood.
Bottom line is that you must be very careful if you use these clauses in your contracts because, in his words, "Courts do not like these provisions and will try very hard to find a reason to invalidate them."
We hear about these clauses frequently from subcontractors. Fortunately most of them, now, when they see this provision in a contract, refuse to get involved.
That's my advice – don't get involved. If you're a subcontractor you can take it a step further and tell the general contractor that they shouldn't have a project where the owner sets the payment schedule. These are jobs to be walked away from. If you desperately need the job so badly that you would sign anything to get the job, it's time to make other changes in your business.
You are not a bank or lender. Don't get in the business of financing other jobs, and don't let others set your payment schedule.