20 gallons about, yeah! What kind of filter have you got, and have you got plants?
I don't know much about barbs, or really even much about tetras, but I feel like that's too many mid/top level shoaling groups with tetras, danios, AND barbs, in a 20 gallon tank.
as for the bottom level, I don't think all those shoaling groups would be a good idea for a tank that's so small. I'd pick one or two species of cories, or a species of cory and the loaches. OR even just do the loaches.
The thing about cories schooling with other species of cory, i'm told,s that they only do it out of stress because they don't have enough of their own kind.
As for the betta, it really depends on the individual betta. My veil tails are both kinda snotty boys, though they do alright with snails. My plakat is a dream, and only bugs his tank mates a little. Of course personality is unique to each one, but if he's alright with the barbs, he'd probably be okay with a group of bottom feeders.
aqadvisor.com can help you figure out good stocking numbers, though from what people have told me, it's on the conservative side. it Reaaaally has helped me stock my tanks though. And it's fun to play with.
So, I'd personally stick with 6-8 barbs, since you've already got those, 5-8 of the bottom feeders (less than 4 per species is not always a good idea) and then the betta :) Lots of hiding spots and plants and caves are always a good idea- my cories will hide under my driftwood, then come out when they think it's safe and go nuts! (i've got a shoal of 9 bronze cories

)