Yes. This is good to do before and after meditation (as opposed to DURING meditation) for the beginner and advanced student alike. (This is traditionally included in the form of loving kindness meditation e.g. "May I/all beings be free from suffering" etc.)
DURING meditation however, whether it is samatha or vipassana, it is generally important to focus on practicing the technique: calmness abiding or naked awareness. On the other hand, one can use affirmations to summon specific qualities. I would recommend only using the same words as found in Buddhist manuals.
For example, the Five Faculties are important to have in balance. One can make up affirmations relative for each characteristic. For example for mindfulness: "my mindfulness faculty is balanced and strong"
Your question though was aimed at the preliminary aspect of just setting up meditation habit which is absolutely crucial and I would recommend the following affirmations:
- I find it easy to sit in samatha
- I sit without distraction for however long I like
Be intelligent in your affirmation design and do not make them unrealistic.
Conclusively, understanding Buddhism in relation to purpose and life's priorities is the best fix-all though (i.e. motivation) and I would recommend the free book "Mastering the Core Teachings of the Buddha" to get a good modern understanding of this.