Could it be the isHistoryEmpty() code doesn't run for you simply because it worked once and now the history is not empty?
$ curl https://mkaminsky.firebaseio.com/.json
{"users":{"-J6J90xrR-D-XC6WE23F":{"color":"#d5b3ff"}},"history":{"A0":{"a":"-J6HUBET5icmC-yXAkJb","o":["//hello"]}}}
Try clearing your firebase or using a fresh namespace for the firepad documents. The easiest way to test fresh namespaces is
Firepad.fromCodeMirror(firepadRef.push(), codeMirror);
which consistently runs the isHistoryEmpty() branch for me (tested on https://cben-sandbox.firebaseio.com/, Chrome & Firefox).