It's not as easy as you think. Actually, you can't intercept icmp packet at the application level. Probably you will need to write a network driver (it can't be done in Delphi, you will need C/C++ and Driver Development Kit).
Or you can use a third-party driver, like Packet Sniffer SDK:
http://www.microolap.com/products/network/pssdk/Also you can use an free utility, like ICMP Interceptor:
http://www.sabronet.com/icmpinterceptor/icmpinterceptor.html