If you want to use the LONG variable that gives you 32 bit math you will have to upgrade to 2.50.

When moving your code from a 16F to an 18F there will be some modifications needed. example, the 16F877 does not have comparators, so you may hace to turn them off on the 18F chip depending on the pins used.

As far as pin outs go, and as far as I know, all of the 40 pin PICs use the same pins for power, programming, OSC and MCLR.

The 18Fs will have several extra features, that may or may not be useful, such as USB pins and may even have an internal OSC.

An 18F4320 might be a good one to start with. It has an internal OSC, but does not have USB.