I can't think of a way of knitting a vertical slit without breaking the yarn, but there is a way of making the joining and breaking less 'bitty'.
Knit across the full with of the scarf until you reach the row where you want the slit to start.
Decide how many stitches wide you want your slit to be (as your scarf is 24 stitches, I would make the slit an even number eg 2 stitches).
Knit across 11 stitches (half your scarf sitiches minus half your slit stitches).
Using a new ball of yarn and joining it at stitch 12 (drop the 'old' yarn at this point) cast off 2 stitches and knit across the remaining 11 stitches.
You should now have 11 stitches, a gap, 11 stitches on your needle.
Using each ball knit each half seperately, untill your slit is the required length. (Some people knit both halves at the same time and others knit one half and go back to the 'other' yarn and then knit the 2nd half. Both methods are as good as each other.)
When you reach the row where you want to finish the slit knit across the 1st half, and continuing with the same yarn cast on the same number of stiches that you cast off (the knitting on or cable cast ons are good for this) and continue to knit across the 2nd half of your scarf. You'll now have 24 stitches back on your needle. At this point cut the 'other' yarn that you no longer need leaving an end for weaving in.
Keep knitting across the full width of your scarf untill it is the final length and cast off.
You will have 2 ends to weave in, one where you joined the 2nd yarn and one where you cut it, but that shouldn't be too much trouble to deal with.
Hope that helps.