You have to rewrite part of MyGateWay.cpp or create your own class. It is not that easy that it looks like at first glance. I did it but it didn't end up in that good functionality so I skipped it and made a separte sensor and keept the Gateway unchanged. You have another answer in the same direction here: http://forum.mysensors.org/topic/722/is-it-possible-to-have-an-ethernet-gateway-also-act-as-a-node-single-arduino-setup/4