there's many different way to do a keyboard scan.. it's up to you to decide how to. There's few example here and there who show you how the author think. You can even use only one single pin using a a/d input. I/O expander, dedicated IC... list is long enough.

Now, there's no real problem using the ICSP pin as long as you respect the ICSP convention stated in the Microchip ICSP guide.

few months ago i posted a copy/paste solution bellow.
http://www.picbasic.co.uk/forum/showthread.php?t=3250

just make sure you disable the analog comparator on PORTA and you should be in business.

Need more info?
http://www.melabs.com/resources/samples/x1/pbp/keyx.bas
http://www.rentron.com/serkey16.htm
http://www.rentron.com/PicBasic/crosspoint.htm