If I use the the iTunes share function to share all my music on my iMac and the iMac goes into sleep mode will it wake when I use my Macbook to play the shared files?
No, though it's possible to wake a Mac remotely over the network.
What you want is a "wake on LAN" signal; you enable this in the Energy Saver preference pane by checkin the "Wake for ethernet access" box.
Now, if you have a recent-model Apple router with updated firmware and the computer you want to wake is running 10.6, the Mac will actually show up in the Servers sidebar of the Finder even when it's asleep, and selecting it will wake it automatically. I don't think just accessing iTunes is good enough, but clicking on it in the Finder and then going to iTunes will work.
If you don't have an Apple router you can still do this, but it's going to require a 3rd party app; I've used this one in the past and it seemed to work fine (it also includes a handy Dashboard widget ): http://www.versiontracker.com/dyn/moreinfo/macosx/24421
Basically bring up that app or the Dashboard widget, wake the computer remotely, then go to iTunes and listen away.