The Wait x seconds command does not stop all execution of code. It only affects the lines immediately after it.
So, the last two lines of the function "onCollision" will happen after the wait, but the rest of your game code will continue to run every tick (1/60 of a second). That means if you call "RestartFunction" right after calling "onCollision" then that will happen in the SAME tick.
Another thing to be careful of is that after the wait time is up, when those last two lines do execute, the function will no longer have the same objects picked. In your case you may only have one explosion object, so it would probably be ok. But if your function is meant to do something to one enemy, then lines after a wait command would apply to all enemies unless you re-pick the one you want.
You could move calling the RestartFunction inside the onCollision function (after the Wait line). Or have a Game Over message pop up, and have the user decide when to restart while the explosion is still running in the background...