(..) should be OK. You don't want a column as an output being connected to a row which is also an output. Both inputs would not work but wouldn't do any harm.
Connection to your PC is via the USB so it should be safe enough.
The sketch. It is pretty straightforward. The biggest thing is setting the pins and ports to either input or output, but it is very logical. (...)
Hm... there's a number of words in there that makes me think it's all a bit .... sketchy - but what do I know!