Interesting idea, something I'd wish to have too sometimes. Unluckily the "only inside a function" thing means that there would have to be some considerable AS built into Code::Blocks, which currently isn't the case.
So... yes, "replace in files" sure works, but it's not precisely what you want.