CJam, 1717 16 bytes
{`"_~"+q~{W%}&`"_~"+Wq~g#%}_~ A fairly straight-forward modification of the standard quine. This also worksOther solutions for the same byte count17 bytes:
{`"_~"+q~{W%}&}_~ {`"_~"+q~!2*(%}_~ If I can assume that the input is only 0 or 1 (as a stand-in for a boolean, which there is no dedicated type for in CJam), I get 15 by omitting the g:
{`"_~"+Wq~#%}_~ Explanation
{`"_~"+ e# Standard generalised quine framework. Leaves the source code on the stack. q~ e# Read and evaluate input. {W%}& e#W If it's truthy, reverse the string. }_~ And the other one:
{`"_~"+ e# Standard generalised quine framework. Leaves the source code onPush thea stack-1. q~ e# Read and evaluate input. !g e# Logical NOTsignum, turning 0truthy values into 1, and everything else into(leaving 0 unchanged). 2*(# e# Double, decrement,e# givingPower. 1-1^0 for== falsy1, input-1^1 and== -1 for truthy input. % e# Select every Nth element: a no-op for 1 and reverses the string for -1. }_~