So, at this point, I have played 25 FIDE-rated games, and I expect to have played the full 30 games by the end of the month. According to the FIDE handbook, this means my K-factor will be reduced from 40 to 20 next month. However, being quite underrated due to my underwhelming early performances, I want to make use of the fact that my K-factor is still 40 this month and register for another tournament; I'm hoping that my K-factor remains 40 this month no matter how many games I play, and that I am hence be able to gain some rating before the month ends. Is this assumption justified? Or will the K-factor change to 20 as soon as the 30 games are up, despite the fact that the month won't yet have ended? And if so, will the K-factor change in the middle of the event or only after its completion?
As you state it, yes.
Your k-factor can change in the middle of the month/event.
Your k-factor will remain 40 until you played your first 30 games.
This is stated in the FIDE Handbook:
K = 40 for a player new to the rating list until they have completed events with at least 30 games.
For game 31 your k-factor will become 20 (if your elo doesn't exceed 2400). Elo calculation will be based on the elo that you've reached in the first 30 games.
Note that the formula for calculation of the first 30 games is different than the 'normal' elo calculation.
There are some exceptions but generally that's it.