You are asking for "RMW" troubles with code like sequential writes to a PORTx register.
That MCU has LAT registers so you should always obey the golden rule: "Read form the PORT, write to the LAT".
Also NEVER play wth the GIE bit in an ISR. Read the last few paragraphs of Section 9.0 of the data sheet to understand why your code is ineffective (or at least the tiny snippet that you have shown).
Why are you defining TRISA to be 0 - that makes no sense at all. Also unless you set the REAL TRISA bits for output, they will default to input.
The PIC18F4550 does not have any ADSELx registers. I have no idea how the compiler managed to not throw all sorts of errors (unless you have more statements like the TRISA define that defines a variable called ANSELA).
What are you trying to do with the assignments to PORTAbits.AN0! I would doubt if there is a bit defined with that name (but I could be wrong there) as the data sheet shows that the *function* AN0 is an analog input using that pin. Therefore there is no point in assigning a value to it.
Can I suggest that you start with a 'flash a LED' style program so that you understand the basics. Also read the data sheet and don't copy code that you don't understand. That is not the way to learn.
Susan