If they could get rid of the nuisance with just this, it was a small price to pay, and everyone was overjoyed.

Literal

This-much [with-で] nuisance-disposal can-do-[if-たら] cheap thing [is-で], everyone greatly-rejoiced.

安いもので doesn't mean a thing was literally inexpensive — 安い here is the figurative 'cheap' of 'a small price to pay,' and もので is the て-form of もの + the copula で, glossable as 'being a [thing of that nature], [next clause].' So 安いもので reads 'being a small price to pay, [and so] everyone was thrilled.' 厄介払い (やっかいばらい) is a noun for 'getting rid of a nuisance / driving off something troublesome' — not malicious, just relieved-eviction. The ~たら conditional sets up the relief: 'if all this took to get rid of the bother, then…'.