OK, I'm not 100% on these answers, but my emulator does pass blargg's dmg_sound test, so I'll give it a shot:
Q1: Is the "enabled flag" that's mentioned in the Wiki the same as the length enable flag in bit 6 of NRx4?
No, I don't think so. It describes it as an "internal enabled flag", which implies its value is not exposed to the user. In my emulator, I use the NR52 status bit for this.
Q2: I currently have the following logic for outputting the current waveform. Is this logic correct?
This seems like it should work, but I don't do it this way. Since we need to update the status bit anyway, I clear it when the length becomes zero. Then I check it to determine whether I need to produce a sample for that channel. This way I don't ouptut sound if the sweep causes the status to be disabled either.
Q2.5: I'm using the same logic for NR52's status bits. (1 if length != 0 || !length_enable, 0 otherwise.) Is this also correct?
Same as above, I manipulate the status bit independently. A few things can affect this, length counter, DAC enabled, sweep overflow, and writing to NR10 (in a specific case).
Q3: The Wiki mentioned that when a channel is triggered it becomes enabled. Does this mean enabling length_enable (bit 6 of NRx4) OR the "enabled flag" that's mentioned in the Wiki?
I think it just means that the channel will start producing sound, so yeah the "enabled flag". You can trigger a channel without enabling the length counter, for example.
Q4: During a trigger event, if the length counter is 0, it is set to either 64(square and noise) or 256(wave). Aren't 63 or 255 the correct values?
It seems like 64 and 256 are correct. But there is a case where it will be 63 or 255, see under "Obscure Behavior" on that wiki:
If a channel is triggered when the frame sequencer's next step is one that doesn't clock the length counter and the length counter is now enabled and length is being set to 64 (256 for wave channel) because it was previously zero, it is set to 63 instead (255 for wave channel).