Here are some approaches that can prevent you from getting stuck or allow you to get unstuck in the middle of writing a piece. What works for you probably depends on what you're most struggeling with. These work for me:
- Plan the form first. If finishing a piece is a constant struggle, lay out a detailed plan of the piece before writing the first note or even thinking about the subject. Write down the length of the subject, details about its development, and key changes, all with bar numbers. Steal these things relentlessly from the big wigs until you can pull it off yourself.
- Be clear about what constitues your own style. Use these features sparingly but with consistency.
- Consider writing the piece in the form of a lead sheet first, i.e. only the main melody plus chord symbols. This helps if you tend to get stuck in minor details and lose your way.
- If in doubt, err on the side of too much repetition or too little variation of a motive or subject. It is easier to break symmetries later than to fit them in where they are lacking.
- If you need a break, first finish the part you are working on, if necessary by just drafting the missing bars. It can be difficult to get into an unfinished part again, but it is easy to add more details to a draft.
- In the process of writing, strictly avoid all judgement of what you are doing. The creative process is powered by your subconscious mind, and while it is at work, your power of judgement, being a faculty of your conscious mind, is extremely poor. You can judge your work only after you haven't touched it for at least one day.
- When the piece is finished, describe in three bullet points what you did well and in three more what you would like to do differently next time. Write these points down at the bottom of the score.
If you have your own approaches, post them here. By writing things down you may learn more than anyone who will read it.