THe only restriction in this ability is that you can't activate it if you don't have 10 cards in your library. but you may activate it twice if you wan't if you stack the abilities correctly, as you did

Concerning resolution, the first resolution is OK, the second is the same, with the only difference that you don't have 10 cards left in your library; so your opponent takes all the cards an do the same as for the first resolution
