In general, any action you want to perform once it has been determined whether the extension is installed should be placed in the Crossrider.isAppinstalled callback function. So in your case your code would look something like the following:
var appId = 'EXTN_ID'; // Replace this with the id of your extension
$(function() {
// Call the isAppInstalled method
CrossriderAPI.isAppInstalled(appId, function(isInstalled) {
// Callback function
// isInstalled: true if the extension is installed; otherwise false
if (isInstalled) {
// Your code to redirect if extension is installed
} else {
// Your code to redirect if extension is NOT installed
}
});
});