This is the code that works perfectly:
2817D6E0 00008008 Check if Home + DPad-UP is pressed
28907B72 FF000003 Check if value is 3 (endif)
00908923 0000000A Write 10
28907B71 FF000006 Check if value is 6 (not endif)
00908923 00000014 Write 20
28907B71 FF000009 Check if value is 9 (not endif)
00908923 0000001E Write 30
E0000000 80008000 Terminator
It writes all the correct values to address 80908923 based on the value at address 80907B71.
This is the code that just refuses to work as it should (note, the read address is just 1 byte away and the write address is just 4 bytes from the code above):
2817D6E0 00008008 Check if Home and DPad-UP is pressed
28907B72 FF000002 Check if value is 2 (Not endif)
00908927 00000018 Write 24
28907B73 FF000004 Check if value is 4 (endif)
00908927 00000031 Write 49
28907B73 FF000006 Check if value is 6 (endif)
00908927 00000063 Write 99
E0000000 80008000 Terminator
I've tried turning ifs to endifs, without button activator, etc, but at best all that it does is the first write

I have tested both codes independently so that they don't interfere. I did the top code first and tested that it works perfectly. I altered the read address to test and it always wrote the correct values. But it doesn't work if the if/endifs are the same as the bottom code (if, if, endif, endif, terminator) I then copied it and modified it to the new addresses, editing the read address again during testing, but it doesn't work correctly.