I have the impression the OP is a newbie looking for a simple way to add functionality to some working code he already has without the trouble of having to learn how to write a whole new sketch.
That seems an awfully long way from writing or modifying a bootloader.
...R