.γa}2ôε`„PN…- =2ä‡s∍}J©¶.ø¶ì'_®∍DŠ»
Try it online or verify all test cases.
Explanation:
.γ # Consecutive group the (implicit) input by:
a # Check if the character is a letter
}2ô # After the group by: split it into parts of size 2
ε # Map each pair of integer + letter to:
` # Pop and push them separated to the stack
„PN # Push string "PN"
…- = # Push string "- ="
2ä # Split it into 2 parts: ["- ","="]
‡ # Transliterate the "P" to "- " and "N" to "="
s # Swap to take the integer value
∍ # Extend (or shorten) the string to that length
}J # After the map: join all parts together to a single string
© # And store it in variable `®` (without popping)
¶.ø # Surround it with a leading and trailing newline
¶ì # Prepend an additional newline for the required asymmetrical output
# (otherwise a mirror could have been used to save some bytes)
'_ '# Push string "_"
®∍ # Extend it to a size equal to the length of string `®`
D # Duplicate it
Š # Triple swap the three values on the stack from a,b,c to c,a,b
» # Join the values on the stack with newline delimiter
# (after which the result is output implicitly)