Interesting point, I think you cannot use the builtin GoToPage, maybe in the future you give us an idea 🙂
The most simple solution coming up in mind is to create a global javascript variable called for example myEpubTotalPages and put it to project html header in this way:
window['myEpubTotalPages'] = 6
where 6 is the number of pages.
then use it in the run javascript action, such as:
var paths = window.location.pathname.split('/');
var currPageNum = parseInt(paths[paths.length-2]);
var newPage = Math.floor(Math.random() * (window['myEpubTotalPages'])) + 1;
while (newPage == currPageNum) newPage = Math.floor(Math.random() * (window['myEpubTotalPages'])) + 1;
window.location.href = '../'+newPage+'/page.xhtml';
idea here is to jump to a page between 1 and "myEpubTotalPages" avoiding current page