Suitability of interrupts for this application notwithstanding, generally speaking, you want to quickly do what needs to be done in the ISR and then set a flag. Pick up that flag and do the time-consuming processing as part of your non-ISR code:
volatile bool doLargeTask = false;
void myISR(void);
void setup() {
// Attach interrupts and do other stuff here
}
void loop() {
// Do your main processing here
if (doLargeTask) {
noInterrupts();
doLargeTask = false;
interrupts();
// Do the time-consuming task here
}
// Continue with main processing
}
void myISR() {
// Quickly service hardware, etc here
doLargeTask = true;
}