It looks like it should work... to debug I'd add this code after the ->execute() line:
var_dump($InsertQuery);
die();
That should:
1) tell you if it is getting into the IF statement and trying to do the insert at all
2) show you any errors that might be occurring