it should be no problem at all, just download the program, say yes to resize your 5/40 tables and carry on from there. I did the same thing recently. I moved the program from a 5/40E into a 5/80E since I had about 50k left unused. I then placed an ASB in the place of the 5/40E ... well that's going into another topic but yes you shouldnt have any problems with what you want to do.
I think that you can swap to the 5/80 plc without any particular problems. However, if the sole reason for the change is to get more rack space for VFD's, then you may want to consider going to a Devicenet interface on the drives. With Devicenet you can read information directly from the VFD into integer or floating point files without using up any part of your I/O image table. -- On the other hand, if the existing racks don't have room for a Devicenet scanner, or you don't want a different VFD interface, then converting to the 5/80 processor may be the way to go.