here's some pseudocode for you...
X = {some range of hands before the draw}
Y = {some range of hands after the draw}
read cards
if hand is better than X
bet or call
else
fold
draw cards
if hand is better than Y
bet or call
else
fold
doomswitch code