Your program looks OK so far, except that you have 2 identical routines in there, for printing the different texts. To avoid that kind of redundancy, you want to use the indirect indexed addressing for reading data. Your "print text" routine would look something like this:
Code:
PrintText:
;multiply the string index by 2
asl
;copy the address of the string to RAM
tay
lda StringPointers+0, y
sta StringPointer+0
lda StringPointers+1, y
sta StringPointer+1
;reset PPU latch
lda $2002
;set the target address
lda #$21
sta $2006
lda #$08
sta $2006
;prepare to read the first character
ldy #$00
TextLoop:
;load the character
lda (TextPointer), y
;skip to the end if this is the end of the string
beq TextEnd
;print the character
sta $2007
;move on to the next character
iny
bne TextLoop
TextEnd:
;return
rts
The main difference from your current routine is that it doesn't use a hardcoded address to read the string, it reads the address from a table of string pointers. Since each address is a word (2 bytes), you can have up to 128 of them in this table, which you define like this:
Code:
Text0:
.db "This is the first text", $00
Text1:
.db "This is the second text", $00
Text2:
.db "This is the third text", $00
Text3:
.db "This is the fourth text", $00
TextPointers:
.dw Text0
.dw Text1
.dw Text2
.dw Text3
I chose to mark the end of each string with a 0 rather than specify their length, because it's easier that way. See how it works? Now you can print up to 128 strings without having to make a new routine for each one. All you have to do is put the index of the string you want to show (0 to 127) in the accumulator and call "PrintText". If you wanted, you could also make the target address dynamic, so that you could print text to different parts of the screen (you could for example use the X and Y registers to specify a coordinate on the screen where to put the text), instead of using a hardcoded location.
Anyway, this was just a friendly tip, and doesn't really have anything to do with what you actually asked!
So back to your problem: if you want to change a message depending on a certain condition, which means that you have to monitor these condition every frame and request that a message be displayed in case they change.
From looking at your code, I see that you have an empty main loop and all the program logic runs in the NMI handler. This is fine, as long as you perform all the PPU updates first (because those MUST be performed during VBlank) and then run the program logic. So, your program logic will detect the need for a new message and will only request that it be written, it will not write it at that time (this is the drawing buffer concept MetalSlime talked about). Then, in the part of your NMI handler that deals with updating the PPU (the part that must run during VBlank), you'll check for any update requests and perform them as necessary. This will guarantee that all name table updates happen during Vblank.
EDIT: Maybe I should give you a more complete answer.
The simplest solution in your case would be to call the "PrintText" routine during Vblank when necessary. When your program detects that the state of the A button changed, it would set some variables (in your case, a single variable will do the trick) requesting that a new string be written. Something like this:
Code:
;request that the second string be printed
lda #$01
sta StringToPrint
Remember that we can have up to 128 strings with this solution? Because of that, only numbers from 0 to 127 are valid string indexes, anything beyond that is invalid. The cool thing about that is that the numbers from 128 to 255 have the highest bit set, which means that the CPU can detect them as negative numbers. This is perfect, because you can use that to indicate whether there is a string to print or not. So, at the start of your NMI routine you'd have:
Code:
NMI:
;load the index of the string to print
lda StringToPrint
;skip printing if the index is invalid
bmi SkipPrinting
;print the string
jsr PrintText
;prevent the string from being printed again
lda #$ff
sta StringToPrint
SkipPrinting: