I like your solution, but it might not be the most efficient. I think -L option makes samtools search the file once per input region. See this benchmark:
cat /tmp/a.bed
LmjF.01
LmjF.05
LmjF.10
LmjF.20
LmjF.36
With -L option:
time awk '{print $1"\t0\t1000000000"}' /tmp/a.bed \
> | samtools view -L /dev/stdin $bam | wc -l
5015
real 0m1.114s
user 0m1.031s
sys 0m0.057s
Passing individual regions:
time samtools view $bam LmjF.01 LmjF.05 LmjF.10 LmjF.20 LmjF.36 | wc -l 5015 real 0m0.052s user 0m0.026s sys 0m0.018s
You can blat those sequences against the reference genome and find out their chromosomal positions. Then you can use a list of those regions and samtools to extract sequences from the bam file.
Did you ever find a suitable answer? I wanna do the same thing.