Regarding rms, I can't find a reference that gives values for sin/saw waves, so I'm not sure if max is doing it wrong/differently than you'd expect.
As far as an auto level match, take the averages of signals A and B and then divide average B by average A. Multiply the actual A signal by the product of that division. This will make A match the average level of B.
A more interesting way to do this would be to average the two averages to find the mean level between the signals, and then bring BOTH inputs to that level via the division method, rather than one to the other.
p.s. throw an abs~ pre the input of average~ to make your stuff work in positive values.