A solution comes in mind but you have to assign dynamic and text to the same note:
\version "2.19.48"
dynamictext =
#(define-event-function (text) (markup?)
(if (string? text)
(let* ((underscores-replaced
(string-map
(lambda (x) (if (eq? x #\_) #\space x))
text))
(split-text (string-split underscores-replaced #\space))
(formatted (map
(lambda (word)
(if (string-match "^[mrzfps]*$" word)
(markup #:dynamic word)
(markup #:normal-text #:italic word)))
split-text)))
#{
#(make-dynamic-script (make-line-markup formatted))
#})
;; user provided a full-blown markup, so we don't mess with it:
#{
#(make-dynamic-script (markup #:normal-text text))
#}))
\relative b, {
\key g \major
\clef "bass"
\time 3/4
d4\fermata \dynamictext
\markup {
\italic "Fine" \dynamic "p" }
g4
b4
}
HTH