I haven't tried it yet but have been reading up for next year, and
apparently yes, there are an assortment of methods you can use involving
monofilament line and/or shiny things (such as tinsel) fluttering on the
box. There is even a commercially available device called the magic halo
that is supposed to be very effective at keeping house sparrows away from
feeders, although I don't know if it can be used on houses or not.
Generally these methods are recommended after the female has laid the first
egg, because that gives her all day to get used to it before she has to
return to the nest, as opposed to needing to return immediately to incubate
or feed the nestlings -- because there is some risk that the tree
swallow/bluebird inhabitants may be put off by the spookers -- but
apparently the swallows and bluebirds are generally very tolerant of these
sparrow spooking methods, and if you think the birds are at serious risk of
sufering HOSP aggression, it's probably worth a shot.
You'd want to installing monitor the box immediately after installation to
be sure the swallows/bluebirds continue feeding. You could always remove
the spooker if it seems to be scaring them away. I haven't tried spookers
yet but experienced people seem to find them very effective.
Here are a few of the resources I've come across in my travels attempting to
learn about this and other nestbox issues. In particular, if you'd like
personal help, try the Cornell bluebird-L listserv. Here's a general info
page -- the instructions for joining the bluebird list are at the top.
Sparrow control actually seems to be the most talked-about issue on that
list, and if you don't find answers in the archives, the members are quite
willing to help answer your questions.
Here are a few Web pages I've found about sparrow spookers:
Again, not sure the halo works on houses in addition to feeders, so you may
want to check on that.
Finally, if you have feeders, apparently there are mixes that encourage
sparrows more than others. So you might want to look into that in general
so that you are not inadvertently attracting them closer to your home. Of
course, if you live in a suburban or urban area, there's not much you can do
from that angle.
Anyway, good luck, and I'm sorry again about the swallows you lost.