It seems to be working now. Here's what I am doing:
Copy every button flow one by one into notepad, then do a search/replace for lightstate/lighstate_n.
Done two and it seems like I've overlooked one or two when messing around with the manual _n addon.
Thanks for encouragement!