As long as the replacment engine is the same size, part number and configuration - the task is fairly easy. Consult a detailed repair manual for the specific steps.
Need some more information - are you referring to installing a used, a rebuilt, or remanufactured engine into the 2005 model Jeep? Please obtain the current identification numbers, and casting numbers for comparison and interchangeability purposes.
There are different challenges; pro's and con's with these three options - not the least are the costs involved;
First, warranty and reliability - if you plan to keep the vehicle for the next 5-7 years, or more then install a remanufactured engine (long block) with at least a 3 year, unlimited and nationwide, transferrable warranty.
Second, with any replacement engine there are perhipheral parts required to be replaced at the same time; engine mounts, water pump, drive belt tensioner, spark plugs, drive belts, radiator, radiator hoses, hose clamps, heater hoses, fuel filter, air filter, etc. For these inexpensive parts, use an on-line parts resopurce, such as: www.autopartswarehouse.com; www.rockauto.com; www.partsgeek.com - to list only a few.
Some of these are considered as good practice, cheap insurance,while some are required in order to validate and maintain any sort of warranty.
A used engine is, in short - a gamble - but may be an option, depending upon the warranty. Personally, unless you knew the exact history of the used engine itself, then consider this as your third option.
Compare the engine block, and cylinder head casting numbers:
2005 3.7L = EXACT POWERTRAIN part #L3705CR Includes Oil Filter Adapter, Gasket Kit, and Oil Pump; Remanufactured
W/O EGR, W/ NGC, W/ Balance Shaft; Casting: Block - 53020977NW, 53021934AA, 53021933AA, Heads - 53020983AC L/H, 53020984AC R/H, Crankshaft - 53020957AB, Camshafts - 891AAD L/H, 890AAC R/H, Balance Shaft - 53020818
2003 3.7L = EXACT POWERTRAIN part #L3702CR Includes Oil Filter Adapter, Gasket Kit, and Oil Pump; Remanufactured
W/O EGR, W/O NGC, W/ Balance Shaft; Casting: Block - 53020977, 53020977NW, Heads - 53020983AB L/H, 58020984AB R/H, Crankshaft - 53020957AB, Camshafts - 853C/D L/H, 854C/D R/H, Balance Shaft - 53020818
Rebuilt and remanufactured engine sources;
You should expect to pay anywhere from $1800 - $3000 for the engine itself; not including any labor, core exchange charges or replacement parts needed.