I am copying my CD collection onto an external hard drive in lossless (m4a) format
M4A (MPEG-4 audio) is not lossless. It's compressed like MP3.
If I understand your question, you want to keep a large, lossless-format iTunes Library on an external drive, and a smaller, lossy-format copy of that library on your boot drive -- and you are looking for the easiest way to add new material to both.
Presuming that the bulk of the music you're talking about importing comes from CDs, the simplest workflow I can think of is to open each library in iTunes and import the CD in the format you want, then change the library and do it again in the alternative format.
You could perhaps find a third-party audio converter that can read from CDs and send the results to iTunes, but you'd still have to change the iTunes library between takes so that amounts to the same amount of work.
I would imagine that it would be possible to construct an Automator or Applescript that essentially said that when the script is run, it should launch iTunes using library A, rip the CD, close and change iTunes libraries and rip the CD again (each in the correct format of course), but how to do that is beyond me.