Should be possible when selecting the source parts, copy (ctrl-C) and then select the parts which have to be replaced, place the cursor on the timeline where the replace should start and hit (ctrl-V ) paste, if I’m correct the copied parts will replace the selected parts.
Note that Prefs>Editing>Delete Overlaps needs to be active for that to work.
As far as the OP, which concerned midi notes, Cubase doesn’t have that kind of function, as far as I know. There are other ways to achieve that result, reply if you need some tut on that.