Seems that you are doing quite a lot in your code, all you need is to use the .view-pagination class that I mentioned previously
I didn't test the code, but something like this:
$(document).ready(function () {
var list = $(".entitylist.entity-grid").eq(0);
//this hides the list so that the javascript will run before the page renders
$(".view-grid").hide();
$(".view-pagination").hide();
list.on("loaded", function () {
//once the list is loaded, then show the list after the javascript ran. User needs to click on search button to populate list of records and also the page links
$(".btn.btn-default.btn-hg").click(function(){
$(".view-grid").show();
$(".view-pagination").show();
console.log('Test2');
});
})
})