I solved it by using a timer that runs once:
timer1 1 1 join #desiredchannel
This way there is a slight delay before an attempt to join is made and that's enough for nick identification to complete and the join to be successful. Other ways to solve it are welcome, I like to see different approaches.