Hmm.
Well, from the point of view of the IRS, you're entitled to claim both of your children as your dependents. From the point of view of the IRS, your ex would only be able to claim either of the children as dependents if you complete Form 8332 for tax year 2021 for either or both of the children.
You'd still have to comply with the terms of your divorce decree unless your ex lets you off the hook, which they may or may not do, of course.
So I guess I can try to give you my answers to your questions:
1. Typically you'd be able to take any state tax benefit for both your 2020 and 2021 tax returns for your 529 contributions regardless of whether you've claimed the children as your dependents during those years. This assumes that your state has such a benefit and doesn't have any rules requiring the children to be your dependents. My state doesn't, and I don't think any do, but I don't know for sure.
2. For the ACTC, you're required to reconcile what you received in advance (based on the Letter 6419 you should receive soon) with what you should have received (based on the dependents you actually claim). If you received more than you should have, then you may have to repay some or all of the excess. This repayment may be limited if your 2021 MAGI is under $100K (for HOH status) and if the number of children that the ACTC was based on is higher than the number of children you have as dependents in 2021. As the other poster noted, this is calculated on Form 8812, and the repayment and repayment limitation is in Part III of that form.
(If I did the math right, it looks like a filing status of HOH with a 2021 MAGI of $70K would mean that if your ACTC was $1200 or less, you wouldn't have to repay any of the ACTC. But double check my math!)
3. Regarding EIP3 (the third stimulus payment) that you probably received sometime between March and September 2021, unlike ACTC, you do not have to pay whatever you received back. You received what you were entitled to receive based on your 2020 return, and your tax software will calculate what you are entitled to based on your 2021 tax return, and you'll be entitled to the larger of those two amounts.
4. Regarding any education credits, you're only entitled to those in 2021 for whichever dependents you claim on your tax return in 2021.
5. The increase in the CTC age to 18 is currently a temporary increase for 2021. So just to make sure you're saying what I think you are, neither you nor your ex would be entitled to the CTC for the younger child in 2022 unless Congress changes the law in that regard.
6. The 2020 Form 1098-T from the school might have included amounts for spring 2021 - you could look to see if box 7 was checked. I personally ignore 1098-Ts and just keep my own detailed records of expenses paid that qualify for the educational credits (in my case, mostly 529 withdrawals and AOTC) based on the law. As you correctly note, it is (generally) the qualified expenses actually paid, not what the 1098-T might say.
7. Neither of you (but this is pointed at your ex) is entitled to education benefits for any amounts that you didn't actually pay. So he's probably breaking the (tax) law if he took an education benefit based on money you paid. And you would be if you did so.
8. Assuming the $5,400 you paid in 2021 was for academic periods in 2021 or starting in the first three months of 2022, then you are likely entitled to your $3,200 529 distribution being tax free. If you claim the older child, you're also probably entitled to take the AOTC based on the ($5400 - $3200 = ) $2200 of out of pocket expenses you paid. You'd also be entitled to AOTC for additional qualified expenses such as room and board, books and fees, and computer equipment. See the relevant sections of Pub 970 to learn more specifically about the rules and limits and what is included: Chapter 8 is about 529s (it calls them QTPs), and Chapter 2 is about the AOTC.
9. As to your unstated question, as long as your ex is OK with you taking whichever child gives you the best benefit, I'd prepare your tax return both ways - once claiming the eldest, a second time claiming the youngest - and look at the bottom line tax liability for both federal and state taxes and make my decision that way.