I fouled just before the finish, crossed, spun my turn and crossed again — does that count?

Yes, if you do all three parts. Under the definition of Finish, a boat has not finished if, after crossing the line, she takes a penalty under Rule 44.2 — so the first crossing does not lock in. The turn itself must be one turn, made promptly, same direction, including one tack and one gybe. And when you take it at or near the finish, Rule 44.2 requires your hull to be completely on the course side of the line before you finish. Cross, turn, get the whole boat back, then cross for real.

▶ Watch on YouTube ↓ Download (via YouTube)
<iframe width="560" height="315" src="https://www.youtube.com/embed/FPWzD8DK5jI" title="Sailing Kiwi" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p><a href="https://sailing.kiwi.nz/v/FPWzD8DK5jI/">Source: Sailing Kiwi</a></p>

Next on this shelf — The Finish