You can do it like this:
<target name="printMyProperty" depends="askUser">
<echo message="${my.property}"/>
</target>
<target name="askUser" unless="my.property">
<input
message="Enter the value for my.property:"
addproperty="my.property"
/>
</target>
The unless
attribute is the solution to your problem. It means "execute this target only if my.property is not set".