Yes, you can access the real prefix in scriptlets with $RPM_INSTALL_PREFIX, but there is usually no reason to use it if your RPM is created correctly.
If you really know what you are doing then mucking around with scriptlets (%post/%postun code) is OK. However note that all RPM macros are expanded during build time. Ergo things like:
%post
echo %{_prefix}
Would always expand to echo /usr. You can actually look at the scriptlets inside generated RPMs to see how they look expanded. That said...
From the short snippet it seems you are doing the installation incorrectly. Copying/moving files is not normally done in %post/%postun scriptlets. Those run on user's system (usually as root) and it's quite easy to make a devastating mistake completely destroying user's system.
So a somewhat valid snippet:
SourceX: <config_file>
...
%install
...
mkdir -p %{buildroot}%{_sysconfdir}
cp %{SOURCEX} %{buildroot}%{sysconfdir}
...
%files
%config(noreplace) %{_sysconfdir}/<config_file>
...
As an another side note, installation into /usr/local is generally frowned upon (unless you are creating RPMs for your own use).