There doesn't seem anything particularly complicated about that at all?, and certainly no need for long ISR's or software resets.
Probably the only routine needed in the ISR would be to generate the inverter signals, triggered by a timer interrupt - the rest in a simple endless loop in the main program.
But again, if you choose your PIC correctly, I believe there are ones that have specific hardware for generating the required inverter signals.
So what are you actually trying to do in your ISR?, and why does it take a long time?.
my main program is written to charge the battery only while ISR generates
the inverter signals but the thing that makes it particularly difficult
for me to think about is ISR also checks for Battery Low condition: suppose
a Battery Low is detected within ISR then the inverter signals must stop
meaning to disable interrupt . Under this circumstance until supply mains
resumes there is nothing to do but wait for it. Now using RETFIE would
take me some point in the main program which might misses a crucial check
because it goes to a line before the occurrence of Battery Low condition
after the condition actually occurred--that could be inappropriate to
address it. Again i could make the main loop run faster to make the
previous situation immaterial but doing so could switch on and off the
battery charging relay erratically near threshold voltage. so it seems
after the occurrence of Battery Low when mains resumes RESET could be more
deterministic in nature.
Thinking the other way i.e doing this checks in the main loop while
charging the battery as well could solve the whole problem but i
failed to see the program flow in that paradigm. Or that, could it be
possible to make RETFIE go to a particular line?
The ISR could be long in the sense that in my initial design after the
occurrence of Battery Low it will wait there till mains resumes and then
reset the program.