In this work, we investigated the possibility of using response surface methodology to optimize the conditions for the synthesis of molecularly imprinted polyaniline specific to quercetin and horseradish peroxidase simultaneously. The work also discusses the role of horseradish peroxidase during aniline polymerization. As far as we know, a methodology for the synthesis of dual-template imprinted polyaniline selective to low and high molecular weight compounds simultaneously has not been described previously. The imprinted polyaniline layer was obtained on the surface of a microtitration plate, and response surface methodology was used to predict the optimal synthesis conditions to achieve the highest possible selectivity of polyaniline to quercetin (imprinting factor 2.4). We used the predicted optimal conditions to produce a polyaniline-modified microtitration plate and successfully used it for solid-phase extraction of quercetin and horseradish peroxidase with high selectivity (imprinting factors 2.3 and 24.6, respectively) in model solutions. Sorption capacity was 0.7 and 1.2 mg g−1 for quercetin and horseradish peroxidase, respectively. As we can see, the results of response surface methodology prediction were in good agreement with the experimental values of the quercetin imprinting factor.