blastn: What substitution matrix is used?
BLASTN does not use a substitution matrix. There are scores for match, mismatch and gaps which you can also define.

There is no feature available as of now to allow scoring of matches against unknowns. They are considered mismatches (as shown below). If these unknown are in the middle of a HSP, then you can probably re-score the HSP according to your scheme using a python script. If the N stretch is disrupting the HSP, then you can try relaxing the mismatch penalties and reduce word size (basically reduce stringency). I can't think of any other solution.

Query  1    CAGCGTCCANNTCCCGAGGTGCCGGGATTGCAGACGGAGTCTGGTTCACTCAGTGCTCAA  60
            |||||||||  |||||||||||||||||||||||||||||||||||||||||||||||||
Sbjct  8    CAGCGTCCACCTCCCGAGGTGCCGGGATTGCAGACGGAGTCTGGTTCACTCAGTGCTCAA  67

Query  61   TGGTGCCCAGGCTGGAGTGCAGTGGCGTGATCTCGGCTCGCTACANNCTCCACCTCCCAG  120
            |||||||||||||||||||||||||||||||||||||||||||||  |||||||||||||
Sbjct  68   TGGTGCCCAGGCTGGAGTGCAGTGGCGTGATCTCGGCTCGCTACAACCTCCACCTCCCAG  127

Query  121  CCGCCTGCCCTGGCCTCCCAAAGTGCCGAGATTGCAGCCTCTGCCCAGCCGCCACCCC  178
            ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sbjct  128  CCGCCTGCCCTGGCCTCCCAAAGTGCCGAGATTGCAGCCTCTGCCCAGCCGCCACCCC  18