It's really really simple. The door to darkness once opened could only be closed 2 keyblade wielders, one on the light side of the door and the other on the dark side of the door. In the same way, 2 different keys had to be used. 1 from the realm of light and 1 from the realm of darkness.
Mickey somehow knew a new keyblade wielder had been chosen (Sora or Riku) and Mickey knew a realm of light keyblade would have chosen them. So that solved the role for the realm of light side of the door. So Mickey went to the dark realm to obtain a dark realm Keyblade, and also to close the door from that side.
This is really one of the more simple plot points in the series.