How about wrapping your script in an Edit Mode check? Then the lists will be expanded while editing.
var editMode = document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value;
if (editMode != '1')
{
$(document).ready(function(){
$(".category-qms-expand").click(function(){
var id = $(this).attr("id");
var name = id.split("-")[1];
$("#category-qms-" + name).toggle(400);
if($(this).html() == "CLOSE"){
$(this).html("EXPAND");
}
else{
$(this).html("CLOSE");
}
return false;
});
});
}
More info from this post:
How do I know if the page is in Edit Mode from JavaScript?How do I know if the page is in Edit Mode from JavaScript?