%pre and %post are essentially bash shell scripts, independent of the
other lines
Here's a clever snippet (also originated from Chip) that illustrates how
to build part of your kickstart, on the fly, using %pre and %include...
# lots of stuff here...
# ...
# ....
%include /tmp/partinfo
%pre
# Determine how many drives we have
set \$(list-harddrives)
let numd=\$#/2
d1=\$1
d2=\$3
cat << EOF >> /tmp/partinfo
part / --fstype ext3 --size=1024 --grow --ondisk=\$d1 --asprimary
part swap --size=1024 --ondisk=\$d1 --asprimary
#EOF
In the above example, the pre script runs first, and generates a file in
/tmp. That file is then inserted into the kickstart, containing
instructions for drive setup.
The same thing can be done in your case.