The inimitable late Sheldon Brown left us a great post on shifters and gearing and compatibility. The highlights for this kind of swap are:
For the bike getting the bar end shifters:
Likely no problem. If the rear shifter is indexed but the indexing doesn't match the gearing then you can usually switch to 'friction' mode. May be annoying if you are not used to friction shifting, but will be functional and you will get used to it in a ride or two. You may even find that you like being able to 'trim' a shift like you can with friction shifters.
Bar End front shifters are usually friction anyway, so no problem there.
Cables will probably have to be rerouted and bar tape replaced.
For the bike getting the STI shifters
Gearing must match. You will run
into trouble installing 9-speed STI
shifters on a bike with an 8-speed
cluster. The derailleur will usually
work with multiple cog counts if it's
reasonably modern. The indexing/shift
distance is controlled by the index
gears inside the shifters.
Front shifters are indexed as well, and may only work with certain
chainring sizes/configurations.
Again you will probably be re-routing cables along the
handlebars and replacing bar tape.
Brake Levers
You can also run into issues swapping the brake levers. Brakes differ in their 'pull length' so levers that work with center-pull cantilevers like I have on my touring bike won't work if I move them to my old beater mountain bike that uses direct-pull V-brakes.
Here again is Sheldon Brown on Cantilever Brakes - scroll down for the compatibility info.
Summary
If the cog counts are the same and the brake pull is compatible then I say go for it.
I like working on bikes, and live close to a bike shop so that if I need a part it's a quick jaunt. If the gear counts match for the bike this is exactly the kind of thing I would find 'fun' to tackle.