Here's the rule (emphasis mine):
Much like a swift action, an immediate action consumes a very small
amount of time but represents a larger expenditure of effort and
energy than a free action. However, unlike a swift action, an
immediate action can be performed at any time—even if it's not your
turn. Casting feather fall is an immediate action, since the spell can
be cast at any time.
Using an immediate action on your turn is the same as using a swift
action and counts as your swift action for that turn. You cannot use
another immediate action or a swift action until after your next turn
if you have used an immediate action when it is not currently your
turn (effectively, using an immediate action before your turn is
equivalent to using your swift action for the coming turn). You also
cannot use an immediate action if you are flat-footed.
The way this works is that if you use an immediate action and it's not your turn, that counts as your swift action for your upcoming turn.
If you're not flat-footed, you can use one immediate action. If you do, you don't get a swift action when your turn comes around again. If you use a swift actin on your turn, you can still use an immediate once it's not your turn (and it counts as your swift for your next turn). Immediate actions are restored at the end of your turn, the end of the round isn't relevant.
The Monk could also use it on Round #1, Initiative #5. If he did, he couldn't use a swift in round 2 when its his turn, and he couldn't use an immediate in round 2 until after his turn (so he couldn't use it on Round #2, Initiative 20).
Here's an example of the flow:
- Combat Starts. Presuming the monk is flat footed, he can't use an immediate until his turn.
- Round 1, initiative 10 - Monk's turn. Monk uses a swift. At the end of his turn, his immediate action becomes available.
- Round 1, initiative 5 - Monk uses an immediate.
- Round 2, initiative 20 - Monk would like to use another immediate, but can't because his turn hasn't happened yet.
- Round 2, initiative 10 - Monk's turn. He cannot use a swift because he used an immediate. At the end of this turn, he gets his immediate back.
- Round 2, initiative 5 - Monk can use an immediate, but doesn't.
- Round 3, initiative 20 - Monk can still use an immediate, but doesn't.
- Round 3, initiative 10 - Monk's turn, he can use a swift.